Skip to content

Commit ded2565

Browse files
committed
documentation cleanup
1 parent c77f7cb commit ded2565

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

lib/collection.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ const DEPRECATED_FIND_OPTIONS = ['maxScan', 'fields', 'snapshot', 'oplogReplay']
287287
* @param {object} [options.fields] **Deprecated** Use `options.projection` instead
288288
* @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination).
289289
* @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1}
290-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
291290
* @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query.
292291
* @param {boolean} [options.timeout=false] Specify if the cursor can timeout.
293292
* @param {boolean} [options.tailable=false] Specify if the cursor is tailable.
@@ -310,6 +309,7 @@ const DEPRECATED_FIND_OPTIONS = ['maxScan', 'fields', 'snapshot', 'oplogReplay']
310309
* @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.
311310
* @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
312311
* @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.
313313
* @param {ClientSession} [options.session] optional session to use for this operation
314314
* @throws {MongoError}
315315
* @return {Cursor}
@@ -739,6 +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.
742743
* @param {ClientSession} [options.session] optional session to use for this operation
743744
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
744745
* @return {Promise} returns Promise if no callback passed
@@ -814,6 +815,7 @@ Collection.prototype.replaceOne = function(filter, doc, options, callback) {
814815
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
815816
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
816817
* @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.
817819
* @param {ClientSession} [options.session] optional session to use for this operation
818820
* @param {Collection~updateWriteOpCallback} [callback] The command result callback
819821
* @return {Promise<Collection~updateWriteOpResult>} returns Promise if no callback passed
@@ -903,6 +905,7 @@ Collection.prototype.update = deprecate(function(selector, update, options, call
903905
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
904906
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
905907
* @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.
906909
* @param {ClientSession} [options.session] optional session to use for this operation
907910
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
908911
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
@@ -937,6 +940,7 @@ Collection.prototype.removeOne = Collection.prototype.deleteOne;
937940
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
938941
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
939942
* @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.
940944
* @param {ClientSession} [options.session] optional session to use for this operation
941945
* @param {string|object} [options.hint] optional index hint for optimizing the filter query
942946
* @param {Collection~deleteWriteOpCallback} [callback] The command result callback
@@ -1044,7 +1048,6 @@ Collection.prototype.save = deprecate(function(doc, options, callback) {
10441048
* @param {object} [options.fields] **Deprecated** Use `options.projection` instead
10451049
* @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination).
10461050
* @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1}
1047-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
10481051
* @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query.
10491052
* @param {boolean} [options.timeout=false] Specify if the cursor can timeout.
10501053
* @param {boolean} [options.tailable=false] Specify if the cursor is tailable.
@@ -1063,6 +1066,7 @@ Collection.prototype.save = deprecate(function(doc, options, callback) {
10631066
* @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system
10641067
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
10651068
* @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.
10661070
* @param {ClientSession} [options.session] optional session to use for this operation
10671071
* @param {Collection~resultCallback} [callback] The command result callback
10681072
* @return {Promise} returns Promise if no callback passed
@@ -1580,6 +1584,7 @@ Collection.prototype.countDocuments = function(query, options, callback) {
15801584
* @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
15811585
* @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
15821586
* @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.
15831588
* @param {ClientSession} [options.session] optional session to use for this operation
15841589
* @param {Collection~resultCallback} [callback] The command result callback
15851590
* @return {Promise} returns Promise if no callback passed
@@ -1659,6 +1664,7 @@ Collection.prototype.stats = function(options, callback) {
16591664
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
16601665
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
16611666
* @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.
16621668
* @param {ClientSession} [options.session] optional session to use for this operation
16631669
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
16641670
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1692,6 +1698,7 @@ Collection.prototype.findOneAndDelete = function(filter, options, callback) {
16921698
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
16931699
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
16941700
* @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.
16951702
* @param {ClientSession} [options.session] optional session to use for this operation
16961703
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
16971704
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1726,6 +1733,7 @@ Collection.prototype.findOneAndReplace = function(filter, replacement, options,
17261733
* @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
17271734
* @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
17281735
* @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.
17291737
* @param {ClientSession} [options.session] An ptional session to use for this operation
17301738
* @param {Collection~findAndModifyCallback} [callback] The collection result callback
17311739
* @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
@@ -1831,7 +1839,6 @@ Collection.prototype.findAndRemove = deprecate(function(query, sort, options, ca
18311839
* @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}.
18321840
* @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.
18331841
* @param {number} [options.cursor.batchSize=1000] Deprecated. Use `options.batchSize`
1834-
* @param {string|boolean} [options.explain] The verbosity mode for the explain output.
18351842
* @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 >).
18361843
* @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.
18371844
* @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.
@@ -1843,6 +1850,7 @@ Collection.prototype.findAndRemove = deprecate(function(query, sort, options, ca
18431850
* @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
18441851
* @param {string} [options.comment] Add a comment to an aggregation command
18451852
* @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.
18461854
* @param {ClientSession} [options.session] optional session to use for this operation
18471855
* @param {Collection~aggregationCallback} callback The command result callback
18481856
* @return {(null|AggregationCursor)}
@@ -2089,6 +2097,7 @@ Collection.prototype.group = deprecate(function(
20892097
* @param {boolean} [options.jsMode=false] It is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X.
20902098
* @param {boolean} [options.verbose=false] Provide statistics on job execution time.
20912099
* @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.
20922101
* @param {ClientSession} [options.session] optional session to use for this operation
20932102
* @param {Collection~resultCallback} [callback] The command result callback
20942103
* @throws {MongoError}

lib/operations/delete_many.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteManyOperation extends OperationBase {
2424
if (err && callback) return callback(err);
2525
if (r == null) return callback(null, { result: { ok: 1 } });
2626

27-
// If an explain option was executed, don't process the server results
27+
// If an explain operation was executed, don't process the server results
2828
if (this.explain) return callback(undefined, r.result);
2929

3030
r.deletedCount = r.result.n;

lib/operations/delete_one.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteOneOperation extends OperationBase {
2424
if (err && callback) return callback(err);
2525
if (r == null) return callback(null, { result: { ok: 1 } });
2626

27-
// If an explain option was executed, don't process the server results
27+
// If an explain operation was executed, don't process the server results
2828
if (this.explain) return callback(undefined, r.result);
2929

3030
r.deletedCount = r.result.n;

lib/operations/map_reduce.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class MapReduceOperation extends OperationBase {
117117
}
118118

119119
if (this.explain) {
120-
if (this.explain && maxWireVersion(coll.s.topology) < 9) {
120+
if (maxWireVersion(coll.s.topology) < 9) {
121121
callback(new MongoError(`server does not support explain on mapReduce`));
122122
return;
123123
}
@@ -132,7 +132,7 @@ class MapReduceOperation extends OperationBase {
132132
return handleCallback(callback, toError(result));
133133
}
134134

135-
// If an explain option was executed, don't process the server results
135+
// If an explain operation was executed, don't process the server results
136136
if (this.explain) return callback(undefined, result);
137137

138138
// Create statistics value

lib/operations/update_many.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class UpdateManyOperation extends OperationBase {
3333
if (err) return callback(err);
3434
if (r == null) return callback(null, { result: { ok: 1 } });
3535

36-
// If an explain option was executed, don't process the server results
36+
// If an explain operation was executed, don't process the server results
3737
if (this.explain) return callback(undefined, r.result);
3838

3939
r.modifiedCount = r.result.nModified != null ? r.result.nModified : r.result.n;

lib/operations/update_one.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class UpdateOneOperation extends OperationBase {
3333
if (err) return callback(err);
3434
if (r == null) return callback(null, { result: { ok: 1 } });
3535

36-
// If an explain option was executed, don't process the server results
36+
// If an explain operation was executed, don't process the server results
3737
if (this.explain) return callback(undefined, r.result);
3838

3939
r.modifiedCount = r.result.nModified != null ? r.result.nModified : r.result.n;

0 commit comments

Comments
 (0)