Skip to content

Commit b0ed9e9

Browse files
committed
list valid verbosity strings in param types
1 parent f435d32 commit b0ed9e9

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

lib/aggregation_cursor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
328328
* ignores the verbosity parameter and executes in "queryPlanner".
329329
*
330330
* @method AggregationCursor.prototype.explain
331-
* @param {string|boolean=true} verbosity - An optional mode in which to run the explain.
331+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} verbosity - An optional mode in which to run the explain.
332332
* @param {AggregationCursor~resultCallback} [callback] The result callback.
333333
* @return {Promise} returns Promise if no callback passed
334334
*/

lib/collection.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ const DEPRECATED_FIND_OPTIONS = ['maxScan', 'fields', 'snapshot', 'oplogReplay']
309309
* @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.
310310
* @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
311311
* @param {boolean} [options.allowDiskUse] Enables writing to temporary files on the server.
312-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
312+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
313313
* @param {ClientSession} [options.session] optional session to use for this operation
314314
* @throws {MongoError}
315315
* @return {Cursor}
@@ -739,7 +739,7 @@ Collection.prototype.insert = deprecate(function(docs, options, callback) {
739739
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
740740
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
741741
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
742-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
742+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
743743
* @param {ClientSession} [options.session] optional session to use for this operation
744744
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
745745
* @return {Promise} returns Promise if no callback passed
@@ -815,7 +815,7 @@ Collection.prototype.replaceOne = function(filter, doc, options, callback) {
815815
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
816816
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
817817
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
818-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
818+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
819819
* @param {ClientSession} [options.session] optional session to use for this operation
820820
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
821821
* @return {Promise<Collection~updateWriteOpResult>} returns Promise if no callback passed
@@ -905,7 +905,7 @@ Collection.prototype.update = deprecate(function(selector, update, options, call
905905
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
906906
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
907907
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
908-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
908+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
909909
* @param {ClientSession} [options.session] optional session to use for this operation
910910
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
911911
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
@@ -940,7 +940,7 @@ Collection.prototype.removeOne = Collection.prototype.deleteOne;
940940
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
941941
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
942942
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
943-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
943+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
944944
* @param {ClientSession} [options.session] optional session to use for this operation
945945
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
946946
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
@@ -1066,7 +1066,7 @@ Collection.prototype.save = deprecate(function(doc, options, callback) {
10661066
* @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system
10671067
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
10681068
* @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
1069-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1069+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
10701070
* @param {ClientSession} [options.session] optional session to use for this operation
10711071
* @param {Collection~resultCallback} [callback] The command result callback
10721072
* @return {Promise} returns Promise if no callback passed
@@ -1584,7 +1584,7 @@ Collection.prototype.countDocuments = function(query, options, callback) {
15841584
* @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
15851585
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
15861586
* @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
1587-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1587+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
15881588
* @param {ClientSession} [options.session] optional session to use for this operation
15891589
* @param {Collection~resultCallback} [callback] The command result callback
15901590
* @return {Promise} returns Promise if no callback passed
@@ -1664,7 +1664,7 @@ Collection.prototype.stats = function(options, callback) {
16641664
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
16651665
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
16661666
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1667-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1667+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
16681668
* @param {ClientSession} [options.session] optional session to use for this operation
16691669
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
16701670
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1698,7 +1698,7 @@ Collection.prototype.findOneAndDelete = function(filter, options, callback) {
16981698
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
16991699
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
17001700
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1701-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1701+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
17021702
* @param {ClientSession} [options.session] optional session to use for this operation
17031703
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
17041704
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1733,7 +1733,7 @@ Collection.prototype.findOneAndReplace = function(filter, replacement, options,
17331733
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
17341734
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
17351735
* @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
1736-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1736+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
17371737
* @param {ClientSession} [options.session] An ptional session to use for this operation
17381738
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
17391739
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1850,7 +1850,7 @@ Collection.prototype.findAndRemove = deprecate(function(query, sort, options, ca
18501850
* @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
18511851
* @param {string} [options.comment] Add a comment to an aggregation command
18521852
* @param {string|object} [options.hint] Add an index selection hint to an aggregation command
1853-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
1853+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
18541854
* @param {ClientSession} [options.session] optional session to use for this operation
18551855
* @param {Collection~aggregationCallback} callback The command result callback
18561856
* @return {(null|AggregationCursor)}
@@ -2097,7 +2097,7 @@ Collection.prototype.group = deprecate(function(
20972097
* @param {boolean} [options.jsMode=false] It is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X.
20982098
* @param {boolean} [options.verbose=false] Provide statistics on job execution time.
20992099
* @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
2100-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
2100+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
21012101
* @param {ClientSession} [options.session] optional session to use for this operation
21022102
* @param {Collection~resultCallback} [callback] The command result callback
21032103
* @throws {MongoError}

lib/cursor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ class Cursor extends CoreCursor {
10071007
* ignores the verbosity parameter and executes in "queryPlanner".
10081008
*
10091009
* @method
1010-
* @param {string|boolean=true} verbosity - An optional mode in which to run the explain.
1010+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} verbosity - An optional mode in which to run the explain.
10111011
* @param {Cursor~resultCallback} [callback] The result callback.
10121012
* @return {Promise} returns Promise if no callback passed
10131013
*/

lib/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Db.prototype.command = function(command, options, callback) {
312312
* @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}.
313313
* @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.
314314
* @param {number} [options.cursor.batchSize=1000] Deprecated. Use `options.batchSize`
315-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
315+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
316316
* @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 >).
317317
* @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.
318318
* @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.

lib/explain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ExplainVerbosity = {
1111

1212
/**
1313
* @class
14-
* @property {string} verbosity The verbosity mode for the explain output
14+
* @property {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'} verbosity The verbosity mode for the explain output.
1515
*/
1616
class Explain {
1717
/**
@@ -21,7 +21,7 @@ class Explain {
2121
* and false as "queryPlanner". Prior to server version 3.6, aggregate()
2222
* ignores the verbosity parameter and executes in "queryPlanner".
2323
*
24-
* @param {string|boolean} [verbosity] The verbosity mode for the explain output ({'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean})
24+
* @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity] The verbosity mode for the explain output.
2525
*/
2626
constructor(verbosity) {
2727
if (typeof verbosity === 'boolean') {

0 commit comments

Comments
 (0)