You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -352,60 +352,43 @@ export abstract class AbstractCursor<
352
352
returnnewReadableCursorStream(this);
353
353
}
354
354
355
-
hasNext(): Promise<boolean>;
356
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** Get the next available document from the cursor, returns null if no more documents are available. */
380
-
next(): Promise<TSchema|null>;
381
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
382
-
next(callback: Callback<TSchema|null>): void;
383
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* Try to get the next available document from the cursor or `null` if an empty batch is returned
397
385
*/
398
-
tryNext(): Promise<TSchema|null>;
399
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
thrownewMongoInvalidArgumentError('Argument "iterator" must be a function');
428
404
}
429
-
returnmaybeCallback(async()=>{
430
-
forawait(constdocumentofthis){
431
-
constresult=iterator(document);
432
-
if(result===false){
433
-
break;
434
-
}
405
+
forawait(constdocumentofthis){
406
+
constresult=iterator(document);
407
+
if(result===false){
408
+
break;
435
409
}
436
-
},callback);
410
+
}
437
411
}
438
412
439
-
close(): Promise<void>;
440
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* Returns an array of documents. The caller is responsible for making sure that there
451
421
* is enough memory to store the results. Note that the array only contains partial
452
422
* results when this cursor had been previously accessed. In that case,
453
423
* cursor.rewind() can be used to reset the cursor.
454
-
*
455
-
* @param callback - The result callback.
456
424
*/
457
-
toArray(): Promise<TSchema[]>;
458
-
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
* @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead
123
124
*/
124
-
count(): Promise<number>;
125
-
/** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead. */
126
-
count(options: CountOptions): Promise<number>;
127
-
/** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
128
-
count(callback: Callback<number>): void;
129
-
/** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
'cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead '
137
128
);
138
129
if(typeofoptions==='boolean'){
139
130
thrownewMongoInvalidArgumentError('Invalid first parameter to count');
/** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */
0 commit comments