Skip to content

Commit c262a6e

Browse files
committed
- All options are optional
1 parent 845cdcf commit c262a6e

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

mongodb.d.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ declare module "mongodb" {
9191

9292
interface SocketOptions {
9393
//= set seconds before connection times out default:0
94-
timeout: number;
94+
timeout?: number;
9595
//= Disables the Nagle algorithm default:true
96-
noDelay: bool;
96+
noDelay?: bool;
9797
//= Set if keepAlive is used default:0 , which means no keepAlive, set higher than 0 for keepAlive
98-
keepAlive: number;
98+
keepAlive?: number;
9999
//= ‘ascii’|’utf8’|’base64’ default:null
100100
encoding?: string;
101101
}
102102

103103
interface ServerOptions {
104104
// - to reconnect automatically, default:false
105-
auto_reconnect: bool;
105+
auto_reconnect?: bool;
106106
// - specify the number of connections in the pool default:1
107-
poolSize: number;
107+
poolSize?: number;
108108
// - a collection of pr socket settings
109-
socketOptions: any;
109+
socketOptions?: any;
110110
}
111111

112112
interface PKFactory {
@@ -116,46 +116,46 @@ declare module "mongodb" {
116116

117117
interface DBOptions {
118118
//- if true, use native BSON parser
119-
native_parser: bool;
119+
native_parser?: bool;
120120
//- sets strict mode , if true then existing collections can’t be “recreated” etc.
121-
strict: bool;
121+
strict?: bool;
122122
//- custom primary key factory to generate _id values (see Custom primary keys).
123-
pk: PKFactory;
123+
pk?: PKFactory;
124124
//- generation of objectid is delegated to the mongodb server instead of the driver. default is false
125-
forceServerObjectId: bool;
125+
forceServerObjectId?: bool;
126126
//- specify the number of milliseconds between connection attempts default:5000
127-
retryMiliSeconds: number;
127+
retryMiliSeconds?: number;
128128
//- specify the number of retries for connection attempts default:3
129-
numberOfRetries: number;
129+
numberOfRetries?: number;
130130
//- enable/disable reaper (true/false) default:false
131-
reaper: bool;
131+
reaper?: bool;
132132
//- specify the number of milliseconds between each reaper attempt default:10000
133-
reaperInterval: number;
133+
reaperInterval?: number;
134134
//- specify the number of milliseconds for timing out callbacks that don’t return default:30000
135-
reaperTimeout: number;
135+
reaperTimeout?: number;
136136
//- driver expects Buffer raw bson document, default:false
137-
raw: bool;
137+
raw?: bool;
138138
}
139139

140140
interface CollectionCreateOptions {
141141
// {true | {w:n, wtimeout:n} | {fsync:true}, default:false}, executes with a getLastError command returning the results of the command on MongoDB.
142-
safe: bool;
142+
safe?: bool;
143143
// {Boolean, default:false}, serialize functions on the document.
144-
serializeFunctions: bool;
144+
serializeFunctions?: bool;
145145
// {Boolean, default:false}, perform all operations using raw bson objects.
146-
raw: bool;
146+
raw?: bool;
147147
// object overriding the basic ObjectID primary key generation.
148-
pkFactory: PKFactory;
148+
pkFactory?: PKFactory;
149149
// {Boolean, default:false}, create a capped collection.
150-
capped: bool;
150+
capped?: bool;
151151
// {Number}, the size of the capped collection in bytes.
152-
size: number;
152+
size?: number;
153153
// {Number}, the maximum number of documents in the capped collection.
154-
max: number;
154+
max?: number;
155155
// {Boolean, default:false}, create an index on the _id field of the document, not created automatically on capped collections.
156-
autoIndexId: bool;
156+
autoIndexId?: bool;
157157
// {String}, the prefered read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
158-
readPreference: string;
158+
readPreference?: string;
159159
}
160160

161161
export interface Collection {
@@ -233,29 +233,29 @@ declare module "mongodb" {
233233
}
234234

235235
export interface CollectionFindOptions {
236-
limit;
237-
sort;
238-
fields;
239-
skip;
240-
hint;
241-
explain;
242-
snapshot;
243-
timeout;
244-
tailtable;
245-
tailableRetryInterval;
246-
numberOfRetries;
247-
awaitdata;
248-
exhaust;
249-
batchSize;
250-
returnKey;
251-
maxScan;
252-
min;
253-
max;
254-
showDiskLoc;
255-
comment;
256-
raw;
257-
readPreferences;
258-
partial;
236+
limit?;
237+
sort?;
238+
fields?;
239+
skip?;
240+
hint?;
241+
explain?;
242+
snapshot?;
243+
timeout?;
244+
tailtable?;
245+
tailableRetryInterval?;
246+
numberOfRetries?;
247+
awaitdata?;
248+
exhaust?;
249+
batchSize?;
250+
returnKey?;
251+
maxScan?;
252+
min?;
253+
max?;
254+
showDiskLoc?;
255+
comment?;
256+
raw?;
257+
readPreferences?;
258+
partial?;
259259
}
260260

261261
export interface MongoCollectionOptions {

0 commit comments

Comments
 (0)