This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 deletions

View File

@@ -3,7 +3,6 @@
const MongoError = require('./core').MongoError;
const Cursor = require('./cursor');
const CursorState = require('./core/cursor').CursorState;
const deprecate = require('util').deprecate;
/**
* @fileOverview The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB
@@ -203,7 +202,7 @@ class AggregationCursor extends Cursor {
/**
* Add a unwind stage to the aggregation pipeline
* @method
* @param {number} field The unwind field name.
* @param {(string|object)} field The unwind field name or stage document.
* @return {AggregationCursor}
*/
unwind(field) {
@@ -225,12 +224,6 @@ class AggregationCursor extends Cursor {
// aliases
AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
// deprecated methods
deprecate(
AggregationCursor.prototype.geoNear,
'The `$geoNear` stage is deprecated in MongoDB 4.0, and removed in version 4.2.'
);
/**
* AggregationCursor stream data event, fired for each document in the cursor.
*
@@ -329,7 +322,13 @@ deprecate(
/**
* Execute the explain for the cursor
*
* For backwards compatibility, a verbosity of true is interpreted as "allPlansExecution"
* and false as "queryPlanner". Prior to server version 3.6, aggregate()
* ignores the verbosity parameter and executes in "queryPlanner".
*
* @method AggregationCursor.prototype.explain
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity=true] - An optional mode in which to run the explain.
* @param {AggregationCursor~resultCallback} [callback] The result callback.
* @return {Promise} returns Promise if no callback passed
*/