Skip to content

Commit 7fb8b72

Browse files
committed
- Cursor class
1 parent c262a6e commit 7fb8b72

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

mongodb.d.ts

+26-3
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,32 @@ declare module "mongodb" {
227227
hint;
228228
}
229229

230-
export interface Cursor {
231-
toArray(callback: (err: any, results: any[]) => void);
232-
nextObject(callback: (err:any,doc:any) => void);
230+
export class Cursor {
231+
constructor (db, 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);
232+
233+
rewind() : Cursor;
234+
toArray(callback: (err: any, results: any[]) => any) : void;
235+
each(callback: (err: Error, item: any) => void) : void;
236+
count(callback: (err: any, count: Number) => void) : void;
237+
238+
sort(keyOrList : any, callback? : (err, result) => void): Cursor;
239+
sort(keyOrList : String, direction : any, callback? : (err, result) => void): Cursor;
240+
241+
limit(limit: Number, callback?: (err, result) => void): Cursor;
242+
setReadPreference(readPreferences, tags, callback?): Cursor;
243+
skip(skip: Number, callback?: (err, result) => void): Cursor;
244+
batchSize(batchSize, callback: (err, result) => void): Cursor;
245+
246+
nextObject(callback: (err:any, doc: any) => void);
247+
explain(callback: (err, result) => void);
248+
//stream(): CursorStream;
249+
250+
close(callback?: (err, result) => void);
251+
isClosed(): Boolean;
252+
253+
static INIT;
254+
static OPEN;
255+
static CLOSED;
233256
}
234257

235258
export interface CollectionFindOptions {

0 commit comments

Comments
 (0)