forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongodb.d.ts
543 lines (426 loc) · 25.3 KB
/
mongodb.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
// Type definitions for MongoDB
// Project: https://github.com/mongodb/node-mongodb-native
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Documentation : http://mongodb.github.io/node-mongodb-native/
/// <reference path='../node/node.d.ts' />
declare module "mongodb" {
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html
export class MongoClient{
constructor(serverConfig: any, options: any);
static connect(uri: string, options: any, callback: (err: Error, db: Db) => void): void;
static connect(uri: string, callback: (err: Error, db: Db) => void): void;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/server.html
export class Server {
constructor (host: string, port: number, opts?: ServerOptions);
public connect(): any;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/db.html
export class Db {
constructor (databaseName: string, serverConfig: Server, dbOptions?: DbCreateOptions);
public db(dbName: string): Db;
public open(callback: (err : Error, db : Db) => void ): void;
public close(forceClose?: boolean, callback?: (err: Error, result: any) => void ): void;
public admin(callback: (err: Error, result: any) => void ): any;
public collectionsInfo(collectionName: string, callback?: (err: Error, result: any) => void ): void;
public collectionNames(collectionName: string, options: any, callback?: (err: Error, result: any) => void ): void;
public collection(collectionName: string): Collection;
public collection(collectionName: string, callback: (err: Error, collection: Collection) => void ): Collection;
public collection(collectionName: string, options: MongoCollectionOptions, callback: (err: Error, collection: Collection) => void ): Collection;
public collections(callback: (err: Error, collections: Collection[]) => void ): void;
public eval(code: any, parameters: any[], options?: any, callback?: (err: Error, result: any) => void ): void;
//public dereference(dbRef: DbRef, callback: (err: Error, result: any) => void): void;
public logout(options: any, callback?: (err: Error, result: any) => void ): void;
public logout(callback: (err: Error, result: any) => void ): void;
public authenticate(userName: string, password: string, callback?: (err: Error, result: any) => void ): void;
public authenticate(userName: string, password: string, options: any, callback?: (err: Error, result: any) => void ): void;
public addUser(username: string, password: string, callback?: (err: Error, result: any) => void ): void;
public addUser(username: string, password: string, options: any, callback?: (err: Error, result: any) => void ): void;
public removeUser(username: string, callback?: (err: Error, result: any) => void ): void;
public removeUser(username: string, options: any, callback?: (err: Error, result: any) => void ): void;
public createCollection(collectionName: string, callback?: (err: Error, result: Collection) => void ): void;
public createCollection(collectionName: string, options: CollectionCreateOptions, callback?: (err: Error, result: any) => void ): void;
public command(selector: Object, callback?: (err: Error, result: any) => void ): void;
public command(selector: Object, options: any, callback?: (err: Error, result: any) => void ): void;
public dropCollection(collectionName: string, callback?: (err: Error, result: any) => void ): void;
public renameCollection(fromCollection: string, toCollection: string, callback?: (err: Error, result: any) => void ): void;
public lastError(options: Object, connectionOptions: any, callback: (err: Error, result: any) => void ): void;
public previousError(options: Object, callback: (err: Error, result: any) => void ): void;
// error = lastError
// lastStatus = lastError
public executeDbCommand(command_hash: any, callback?: (err: Error, result: any) => void ): void;
public executeDbCommand(command_hash: any, options: any, callback?: (err: Error, result: any) => void ): void;
public executeDbAdminCommand(command_hash: any, callback?: (err: Error, result: any) => void ): void;
public executeDbAdminCommand(command_hash: any, options: any, callback?: (err: Error, result: any) => void ): void;
public resetErrorHistory(callback?: (err: Error, result: any) => void ): void;
public resetErrorHistory(options: any, callback?: (err: Error, result: any) => void ): void;
public createIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback: Function): void;
public ensureIndex(collectionName: any, fieldOrSpec: any, options: IndexOptions, callback: Function): void;
public cursorInfo(options: any, callback: Function): void;
public dropIndex(collectionName: string, indexName: string, callback: Function): void;
public reIndex(collectionName: string, callback: Function): void;
public indexInformation(collectionName: string, options: any, callback: Function): void;
public dropDatabase(callback: (err: Error, result: any) => void ): void;
public stats(options: any, callback: Function): void;
public _registerHandler(db_command: any, raw: any, connection: any, exhaust: any, callback: Function): void;
public _reRegisterHandler(newId: any, object: any, callback: Function): void;
public _callHandler(id: any, document: any, err: any): any;
public _hasHandler(id: any): any;
public _removeHandler(id: any): any;
public _findHandler(id: any): { id: string; callback: Function; };
public __executeQueryCommand(self: any, db_command: any, options: any, callback: any): void;
public DEFAULT_URL: string;
public connect(url: string, options: { uri_decode_auth?: boolean; }, callback: (err: Error, result: any) => void ): void;
public addListener(event: string, handler:(param: any) => any): any;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-bson-generated/objectid.html
// Last update: doc. version 1.3.13 (28.08.2013)
export class ObjectID {
constructor (s?: string);
// Returns the ObjectID id as a 24 byte hex string representation
public toHexString() : string;
// Compares the equality of this ObjectID with otherID.
public equals(otherID: ObjectID) : boolean;
// Returns the generation date (accurate up to the second) that this ID was generated.
public getTimestamp(): Date;
// Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
// time – an integer number representing a number of seconds.
public static createFromTime(time: number): ObjectID;
// Creates an ObjectID from a hex string representation of an ObjectID.
// hexString – create a ObjectID from a passed in 24 byte hexstring.
public static createFromHexString(hexString: string): ObjectID;
// Checks if a value is a valid bson ObjectId
// id - Value to be checked
public static isValid(id: string): Boolean;
// Generate a 12 byte id string used in ObjectID's
// time - optional parameter allowing to pass in a second based timestamp
public generate(time?: number): string;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-bson-generated/binary.html
export class Binary {
constructor (buffer: Buffer, subType?: number);
// Updates this binary with byte_value
put(byte_value: any): void;
// Writes a buffer or string to the binary
write(buffer: any, offset: number): void;
// Reads length bytes starting at position.
read(position: number, length: number): Buffer;
// Returns the value of this binary as a string.
value(): string;
// The length of the binary.
length(): number;
}
export interface SocketOptions {
//= set seconds before connection times out default:0
timeout?: number;
//= Disables the Nagle algorithm default:true
noDelay?: boolean;
//= Set if keepAlive is used default:0 , which means no keepAlive, set higher than 0 for keepAlive
keepAlive?: number;
//= ‘ascii’|’utf8’|’base64’ default:null
encoding?: string;
}
export interface ServerOptions {
// - to reconnect automatically, default:false
auto_reconnect?: boolean;
// - specify the number of connections in the pool default:1
poolSize?: number;
// - a collection of pr socket settings
socketOptions?: any;
}
export interface PKFactory {
counter: number;
createPk: () => number;
}
// See : http://mongodb.github.io/node-mongodb-native/api-generated/db.html
// Current definition by documentation version 1.3.13 (28.08.2013)
export interface DbCreateOptions {
// the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = ‘majority’ or tag acknowledges the write.
w?: any;
// set the timeout for waiting for write concern to finish (combines with w option).
wtimeout?: number;
// write waits for fsync before returning. default:false.
fsync?: boolean;
// write waits for journal sync before returning. default:false.
journal?: boolean;
// the prefered read preference. use 'ReadPreference' class.
readPreference?: string;
// use c++ bson parser. default:false.
native_parser?: boolean;
// force server to create _id fields instead of client. default:false.
forceServerObjectId?: boolean;
// custom primary key factory to generate _id values (see Custom primary keys).
pkFactory?: PKFactory;
// serialize functions. default:false.
serializeFunctions?: boolean;
// peform operations using raw bson buffers. default:false.
raw?: boolean;
// record query statistics during execution. default:false.
recordQueryStats?: boolean;
// number of miliseconds between retries. default:5000.
retryMiliSeconds?: number;
// number of retries off connection. default:5.
numberOfRetries?: number;
// an object representing a logger that you want to use, needs to support functions debug, log, error. default:null.
logger?: Object
// force setting of SlaveOk flag on queries (only use when explicitly connecting to a secondary server). default:null.
slaveOk?: number;
// when deserializing a Long will fit it into a Number if it’s smaller than 53 bits. default:true.
promoteLongs?: boolean;
}
export class ReadPreference {
public static PRIMARY: string;
public static PRIMARY_PREFERRED: string;
public static SECONDARY: string;
public static SECONDARY_PREFERRED: string;
public static NEAREST: string;
}
// See : http://mongodb.github.io/node-mongodb-native/api-generated/collection.html
// Current definition by documentation version 1.3.13 (28.08.2013)
export interface CollectionCreateOptions {
// the prefered read preference. use 'ReadPreference' class.
readPreference?: string;
// Allow reads from secondaries. default:false.
slaveOk?: boolean;
// serialize functions on the document. default:false.
serializeFunctions?: boolean;
// perform all operations using raw bson objects. default:false.
raw?: boolean;
// object overriding the basic ObjectID primary key generation.
pkFactory?: PKFactory;
}
// Documentation: http://docs.mongodb.org/manual/reference/command/collStats/
export interface CollStats {
// Namespace.
ns: string;
// Number of documents.
count: number;
// Collection size in bytes.
size: number;
// Average object size in bytes.
avgObjSize: number;
// (Pre)allocated space for the collection in bytes.
storageSize: number;
// Number of extents (contiguously allocated chunks of datafile space).
numExtents: number;
// Number of indexes.
nindexes: number;
// Size of the most recently created extent in bytes.
lastExtentSize: number;
// Padding can speed up updates if documents grow.
paddingFactor: number;
flags: number;
// Total index size in bytes.
totalIndexSize: number;
// Size of specific indexes in bytes.
indexSizes: {
_id_: number;
username: number;
};
}
// Documentation : http://mongodb.github.io/node-mongodb-native/api-generated/collection.html
export interface Collection {
new (db: Db, collectionName: string, pkFactory?: Object, options?: CollectionCreateOptions): Collection; // is this right?
/**
* @deprecated use insertOne or insertMany
* Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insert
*/
insert(query: any, callback: (err: Error, result: any) => void): void;
insert(query: any, options: { safe?: any; continueOnError?: boolean; keepGoing?: boolean; serializeFunctions?: boolean; }, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insertOne
insertOne(doc:any, callback: (err: Error, result: any) => void) :void;
insertOne(doc: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#insertMany
insertMany(docs: any, callback: (err: Error, result: any) => void): void;
insertMany(docs: any, options: { w?: any; wtimeout?: number; j?: boolean; serializeFunctions?: boolean; forceServerObjectId?: boolean }, callback: (err: Error, result: any) => void): void;
/**
* @deprecated use deleteOne or deleteMany
* Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#remove
*/
remove(selector: Object, callback?: (err: Error, result: any) => void): void;
remove(selector: Object, options: { safe?: any; single?: boolean; }, callback?: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#deleteOne
deleteOne(filter: any, callback: (err: Error, result: any) => void): void;
deleteOne(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#deleteMany
deleteMany(filter: any, callback: (err: Error, result: any) => void): void;
deleteMany(filter: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void;
rename(newName: String, callback?: (err: Error, result: any) => void): void;
save(doc: any, callback : (err: Error, result: any) => void): void;
save(doc: any, options: { w?: any; wtimeout?: number; j?: boolean;}, callback : (err: Error, result: any) => void): void;
/**
* @deprecated use updateOne or updateMany
* Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#update
*/
update(selector: Object, document: any, callback?: (err: Error, result: any) => void): void;
update(selector: Object, document: any, options: { safe?: boolean; upsert?: any; multi?: boolean; serializeFunctions?: boolean; }, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#updateOne
updateOne(filter: Object, update: any, callback: (err: Error, result: any) => void): void;
updateOne(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#updateMany
updateMany(filter: Object, update: any, callback: (err: Error, result: any) => void): void;
updateMany(filter: Object, update: any, options: { upsert?: boolean; w?: any; wtimeout?: number; j?: boolean;}, callback: (err: Error, result: any) => void): void;
distinct(key: string, query: Object, callback: (err: Error, result: any) => void): void;
distinct(key: string, query: Object, options: { readPreference: string; }, callback: (err: Error, result: any) => void): void;
count(callback: (err: Error, result: any) => void): void;
count(query: Object, callback: (err: Error, result: any) => void): void;
count(query: Object, options: { readPreference: string; }, callback: (err: Error, result: any) => void): void;
drop(callback?: (err: Error, result: any) => void): void;
/**
* @deprecated use findOneAndUpdate, findOneAndReplace or findOneAndDelete
* Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findAndModify
*/
findAndModify(query: Object, sort: any[], doc: Object, callback: (err: Error, result: any) => void): void;
findAndModify(query: Object, sort: any[], doc: Object, options: { safe?: any; remove?: boolean; upsert?: boolean; new?: boolean; }, callback: (err: Error, result: any) => void): void;
/**
* @deprecated use findOneAndDelete
* Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findAndRemove
*/
findAndRemove(query : Object, sort? : any[], callback?: (err: Error, result: any) => void): void;
findAndRemove(query : Object, sort? : any[], options?: { safe: any; }, callback?: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndDelete
findOneAndDelete(filter: any, callback: (err: Error, result: any) => void): void;
findOneAndDelete(filter: any, options: { projection?: any; sort?: any; maxTimeMS?: number; }, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndReplace
findOneAndReplace(filter: any, replacement: any, callback: (err: Error, result: any) => void): void;
findOneAndReplace(filter: any, replacement: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback: (err: Error, result: any) => void): void;
// Documentation : http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOneAndUpdate
findOneAndUpdate(filter: any, update: any, callback: (err: Error, result: any) => void): void;
findOneAndUpdate(filter: any, update: any, options: { projection?: any; sort?: any; maxTimeMS?: number; upsert?: boolean; returnOriginal?: boolean }, callback: (err: Error, result: any) => void): void;
find(callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, fields: any, callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, options: CollectionFindOptions, callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, fields: any, options: CollectionFindOptions, callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, fields: any, skip: number, limit: number, callback?: (err: Error, result: Cursor) => void): Cursor;
find(selector: Object, fields: any, skip: number, limit: number, timeout: number, callback?: (err: Error, result: Cursor) => void): Cursor;
findOne(callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, fields: any, callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, options: CollectionFindOptions, callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, fields: any, options: CollectionFindOptions, callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, fields: any, skip: number, limit: number, callback?: (err: Error, result: any) => void): Cursor;
findOne(selector: Object, fields: any, skip: number, limit: number, timeout: number, callback?: (err: Error, result: any) => void): Cursor;
createIndex(fieldOrSpec: any, callback: (err: Error, indexName: string) => void): void;
createIndex(fieldOrSpec: any, options: IndexOptions, callback: (err: Error, indexName: string) => void): void;
ensureIndex(fieldOrSpec: any, callback: (err: Error, indexName: string) => void): void;
ensureIndex(fieldOrSpec: any, options: IndexOptions, callback: (err: Error, indexName: string) => void): void;
indexInformation(options: any, callback: Function): void;
dropIndex(name: string, callback: Function): void;
dropAllIndexes(callback: Function): void;
// dropIndexes = dropAllIndexes
reIndex(callback: Function): void;
mapReduce(map: Function, reduce: Function, options: MapReduceOptions, callback: Function): void;
group(keys: Object, condition: Object, initial: Object, reduce: Function, finalize: Function, command: boolean, options: {readPreference: string}, callback: Function): void;
options(callback: Function): void;
isCapped(callback: Function): void;
indexExists(indexes: string, callback: Function): void;
geoNear(x: number, y: number, callback: Function): void;
geoNear(x: number, y: number, options: Object, callback: Function): void;
geoHaystackSearch(x: number, y: number, callback: Function): void;
geoHaystackSearch(x: number, y: number, options: Object, callback: Function): void;
indexes(callback: Function): void;
aggregate(pipeline: any[], callback: (err: Error, results: any) => void): void;
aggregate(pipeline: any[], options: {readPreference: string}, callback: (err: Error, results: any) => void): void;
stats(options: {readPreference: string; scale: number}, callback: (err: Error, results: CollStats) => void): void;
stats(callback: (err: Error, results: CollStats) => void): void;
hint: any;
}
export interface MapReduceOptions {
out?: Object;
query?: Object;
sort?: Object;
limit?: number;
keeptemp?: boolean;
finalize?: any;
scope?: Object;
jsMode?: boolean;
verbose?: boolean;
readPreference?: string;
}
export interface IndexOptions {
w?: any;
wtimeout?: number;
fsync?: boolean;
journal?: boolean;
unique?: boolean;
sparse?: boolean;
background?: boolean;
dropDups?: boolean;
min?: number;
max?: number;
v?: number;
expireAfterSeconds?: number;
name?: string;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/cursor.html
// Last update: doc. version 1.3.13 (29.08.2013)
export class Cursor {
// INTERNAL TYPE
// constructor (db: Db, collection: Collection, selector, fields, skip, limit, sort, hint, explain, snapshot, timeout, tailable, batchSize, slaveOk, raw, read, returnKey, maxScan, min, max, showDiskLoc, comment, awaitdata, numberOfRetries, dbName, tailableRetryInterval, exhaust, partial);
// constructor(db: Db, collection: Collection, selector, fields, options);
rewind() : Cursor;
toArray(callback: (err: Error, results: any[]) => any) : void;
each(callback: (err: Error, item: any) => void) : void;
count(applySkipLimit: boolean, callback: (err: Error, count: number) => void) : void;
sort(keyOrList: any, callback? : (err: Error, result: any) => void): Cursor;
// this determines how the results are sorted. "asc", "ascending" or 1 for asceding order while "desc", "desceding or -1 for descending order. Note that the strings are case insensitive.
sort(keyOrList: String, direction : string, callback : (err: Error, result: any) => void): Cursor;
limit(limit: number, callback?: (err: Error, result: any) => void): Cursor;
setReadPreference(preference: string, callback?: Function): Cursor;
skip(skip: number, callback?: (err: Error, result: any) => void): Cursor;
batchSize(batchSize: number, callback?: (err: Error, result: any) => void): Cursor;
nextObject(callback: (err: Error, doc: any) => void) : void;
explain(callback: (err: Error, result: any) => void) : void;
stream(): CursorStream;
close(callback: (err: Error, result: any) => void) : void;
isClosed(): boolean;
public static INIT: number;
public static OPEN: number;
public static CLOSED: number;
public static GET_MORE: number;
}
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/cursorstream.html
// Last update: doc. version 1.3.13 (29.08.2013)
export class CursorStream {
constructor(cursor: Cursor);
public pause(): any;
public resume(): any;
public destroy(): any;
}
export interface CollectionFindOptions {
limit?: number;
sort?: any;
fields?: Object;
skip?: number;
hint?: Object;
explain?: boolean;
snapshot?: boolean;
timeout?: boolean;
tailtable?: boolean;
tailableRetryInterval?: number;
numberOfRetries?: number;
awaitdata?: boolean;
oplogReplay?: boolean;
exhaust?: boolean;
batchSize?: number;
returnKey?: boolean;
maxScan?: number;
min?: number;
max?: number;
showDiskLoc?: boolean;
comment?: String;
raw?: boolean;
readPreference?: String;
partial?: boolean;
}
export interface MongoCollectionOptions {
safe?: any;
serializeFunctions?: any;
strict?: boolean;
raw?: boolean;
pkFactory?: any;
readPreference?: string;
}
}