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
Explain support for specific commands is accessible via a
new `explain` option, either a boolean or a string specifying
the requested verbosity, at the operation level. Explainable
cursor operations can also be explained via the existing
cursor `explain` method, which now takes an optional verbosity
parameter (defaults to true for backwards compatibility).
NODE-2853
* For backwards compatibility, a verbosity of true is interpreted as "allPlansExecution"
327
+
* and false as "queryPlanner". Prior to server version 3.6, aggregate()
328
+
* ignores the verbosity parameter and executes in "queryPlanner".
329
+
*
325
330
* @method AggregationCursor.prototype.explain
331
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity=true] - An optional mode in which to run the explain.
326
332
* @param {AggregationCursor~resultCallback} [callback] The result callback.
327
333
* @return {Promise} returns Promise if no callback passed
* @param {boolean} [options.noCursorTimeout] The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
311
310
* @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
312
311
* @param {boolean} [options.allowDiskUse] Enables writing to temporary files on the server.
312
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
313
313
* @param {ClientSession} [options.session] optional session to use for this operation
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
745
745
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
746
746
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
747
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
747
748
* @param {ClientSession} [options.session] optional session to use for this operation
748
749
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
749
750
* @return {Promise} returns Promise if no callback passed
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
822
823
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
823
824
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
825
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
824
826
* @param {ClientSession} [options.session] optional session to use for this operation
825
827
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
826
828
* @return {Promise<Collection~updateWriteOpResult>} returns Promise if no callback passed
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
913
915
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
914
916
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
917
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
915
918
* @param {ClientSession} [options.session] optional session to use for this operation
916
919
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
917
920
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
948
951
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
949
952
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
953
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
950
954
* @param {ClientSession} [options.session] optional session to use for this operation
951
955
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
952
956
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
* @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system
1076
1079
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
1077
1080
* @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
1081
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1078
1082
* @param {ClientSession} [options.session] optional session to use for this operation
1079
1083
* @param {Collection~resultCallback} [callback] The command result callback
1080
1084
* @return {Promise} returns Promise if no callback passed
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
1597
1601
* @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
1602
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1598
1603
* @param {ClientSession} [options.session] optional session to use for this operation
1599
1604
* @param {Collection~resultCallback} [callback] The command result callback
1600
1605
* @return {Promise} returns Promise if no callback passed
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
1675
1680
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
1676
1681
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1682
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1677
1683
* @param {ClientSession} [options.session] optional session to use for this operation
1678
1684
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
1679
1685
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
1708
1714
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
1709
1715
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1716
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1710
1717
* @param {ClientSession} [options.session] optional session to use for this operation
1711
1718
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
1712
1719
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
1742
1749
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
1743
1750
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1751
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1744
1752
* @param {ClientSession} [options.session] An ptional session to use for this operation
1745
1753
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
1746
1754
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1848,7 +1856,6 @@ Collection.prototype.findAndRemove = deprecate(function(query, sort, options, ca
1848
1856
* @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
1849
1857
* @param {object} [options.cursor] Return the query as cursor, on 2.6 > it returns as a real cursor on pre 2.6 it returns as an emulated cursor.
1850
1858
* @param {number} [options.cursor.batchSize=1000] Deprecated. Use `options.batchSize`
1851
-
* @param {boolean} [options.explain=false] Explain returns the aggregation execution plan (requires mongodb 2.6 >).
1852
1859
* @param {boolean} [options.allowDiskUse=false] allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 >).
1853
1860
* @param {number} [options.maxTimeMS] maxTimeMS specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.
1854
1861
* @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.
@@ -1860,6 +1867,7 @@ Collection.prototype.findAndRemove = deprecate(function(query, sort, options, ca
1860
1867
* @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
1861
1868
* @param {string} [options.comment] Add a comment to an aggregation command
1862
1869
* @param {string|object} [options.hint] Add an index selection hint to an aggregation command
1870
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
1863
1871
* @param {ClientSession} [options.session] optional session to use for this operation
1864
1872
* @param {Collection~aggregationCallback} callback The command result callback
* @param {boolean} [options.jsMode=false] It is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X.
2107
2115
* @param {boolean} [options.verbose=false] Provide statistics on job execution time.
2108
2116
* @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
2117
+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
2109
2118
* @param {ClientSession} [options.session] optional session to use for this operation
2110
2119
* @param {Collection~resultCallback} [callback] The command result callback
0 commit comments