diff --git a/lib/admin.js b/lib/admin.js index 3149ca6e06..8fb4cac56a 100644 --- a/lib/admin.js +++ b/lib/admin.js @@ -64,9 +64,9 @@ function Admin(db, topology, promiseLibrary) { * Execute a command * @method * @param {object} command The command hash - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {number} [options.maxTimeMS=null] Number of milliseconds to wait before aborting the query. + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query. * @param {Admin~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed */ @@ -168,13 +168,13 @@ Admin.prototype.ping = function(options, callback) { * @method * @param {string} username The username. * @param {string} password The password. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.fsync=false] Specify a file sync write concern. - * @param {object} [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher) - * @param {object[]} [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher) + * @param {object} [options.customData] Custom data associated with the user (only Mongodb 2.6 or higher) + * @param {object[]} [options.roles] Roles associated with the created user (only Mongodb 2.6 or higher) * @param {ClientSession} [options.session] optional session to use for this operation * @param {Admin~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -203,9 +203,9 @@ Admin.prototype.addUser = function(username, password, options, callback) { * Remove a user from a database * @method * @param {string} username The username. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.fsync=false] Specify a file sync write concern. * @param {ClientSession} [options.session] optional session to use for this operation @@ -235,7 +235,7 @@ Admin.prototype.removeUser = function(username, options, callback) { * Validate an existing collection * * @param {string} collectionName The name of the collection to validate. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Admin~resultCallback} [callback] The command result callback. * @return {Promise} returns Promise if no callback passed @@ -255,7 +255,7 @@ Admin.prototype.validateCollection = function(collectionName, options, callback) /** * List the available databases * - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.nameOnly=false] Whether the command should return only db names, or names and size info. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Admin~resultCallback} [callback] The command result callback. diff --git a/lib/bulk/ordered.js b/lib/bulk/ordered.js index c4635f6743..dc4ac10aa9 100644 --- a/lib/bulk/ordered.js +++ b/lib/bulk/ordered.js @@ -577,9 +577,9 @@ var executeCommands = function(self, options, callback) { * Execute the ordered bulk operation * * @method - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.fsync=false] Specify a file sync write concern. * @param {OrderedBulkOperation~resultCallback} [callback] The result callback diff --git a/lib/bulk/unordered.js b/lib/bulk/unordered.js index acc90513a8..7af4b1e7c6 100644 --- a/lib/bulk/unordered.js +++ b/lib/bulk/unordered.js @@ -588,9 +588,9 @@ var executeBatches = function(self, options, callback) { * Execute the ordered bulk operation * * @method - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.fsync=false] Specify a file sync write concern. * @param {UnorderedBulkOperation~resultCallback} [callback] The result callback diff --git a/lib/change_stream.js b/lib/change_stream.js index 063685e243..03ee9d8d3c 100644 --- a/lib/change_stream.js +++ b/lib/change_stream.js @@ -195,8 +195,8 @@ class ChangeStream extends EventEmitter { /** * Return a modified Readable stream including a possible transform method. * @method - * @param {object} [options=null] Optional settings. - * @param {function} [options.transform=null] A transformation method applied to each document emitted by the stream. + * @param {object} [options] Optional settings. + * @param {function} [options.transform] A transformation method applied to each document emitted by the stream. * @return {Cursor} */ stream(options) { diff --git a/lib/collection.js b/lib/collection.js index b27b6c1712..dfca7b5b3b 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -243,32 +243,32 @@ const DEPRECATED_FIND_OPTIONS = ['maxScan', 'snapshot']; * Creates a cursor for a query that can be used to iterate over results from MongoDB * @method * @param {object} [query={}] The cursor query object. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {number} [options.limit=0] Sets the limit of documents returned in the query. - * @param {(array|object)} [options.sort=null] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc. - * @param {object} [options.projection=null] The fields to return in the query. Object of fields to include or exclude (not both), {'a':1} - * @param {object} [options.fields=null] **Deprecated** Use `options.projection` instead + * @param {(array|object)} [options.sort] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc. + * @param {object} [options.projection] The fields to return in the query. Object of fields to include or exclude (not both), {'a':1} + * @param {object} [options.fields] **Deprecated** Use `options.projection` instead * @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination). - * @param {Object} [options.hint=null] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1} + * @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1} * @param {boolean} [options.explain=false] Explain the query instead of returning the data. * @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query. * @param {boolean} [options.timeout=false] Specify if the cursor can timeout. * @param {boolean} [options.tailable=false] Specify if the cursor is tailable. * @param {number} [options.batchSize=0] Set the batchSize for the getMoreCommand when iterating over the query results. * @param {boolean} [options.returnKey=false] Only return the index key. - * @param {number} [options.maxScan=null] DEPRECATED: Limit the number of items to scan. - * @param {number} [options.min=null] Set index bounds. - * @param {number} [options.max=null] Set index bounds. + * @param {number} [options.maxScan] DEPRECATED: Limit the number of items to scan. + * @param {number} [options.min] Set index bounds. + * @param {number} [options.max] Set index bounds. * @param {boolean} [options.showDiskLoc=false] Show disk location of results. - * @param {string} [options.comment=null] You can put a $comment field on a query to make looking in the profiler logs simpler. + * @param {string} [options.comment] You can put a $comment field on a query to make looking in the profiler logs simpler. * @param {boolean} [options.raw=false] Return document results as raw BSON buffers. * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution. * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system - * @param {number} [options.maxTimeMS=null] Number of miliseconds to wait before aborting the query. - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {ClientSession} [options.session] optional session to use for this operation * @throws {MongoError} * @return {Cursor} @@ -433,9 +433,9 @@ Collection.prototype.find = function(query, options, callback) { * * @method * @param {object} doc Document to insert. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver. @@ -479,9 +479,9 @@ function mapInsertManyResults(docs, r) { * * @method * @param {object[]} docs Documents to insert. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver. @@ -566,9 +566,9 @@ Collection.prototype.insertMany = function(docs, options, callback) { * * @method * @param {object[]} operations Bulk operations to perform. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.ordered=true] Execute write operation in ordered or unordered fashion. @@ -645,9 +645,9 @@ Collection.prototype.bulkWrite = function(operations, options, callback) { * * @method * @param {(object|object[])} docs Documents to insert. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver. @@ -695,13 +695,13 @@ Collection.prototype.insert = function(docs, options, callback) { * @method * @param {object} filter The Filter used to select the document to update * @param {object} update The update operations to be applied to the document - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.upsert=false] Update operation is an upsert. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher. - * @param {Array} [options.arrayFilters=null] optional list of array filters referenced in filtered positional operators + * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~updateWriteOpCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -732,10 +732,10 @@ Collection.prototype.updateOne = function(filter, update, options, callback) { * @method * @param {object} filter The Filter used to select the document to update * @param {object} doc The Document that replaces the matching document - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.upsert=false] Update operation is an upsert. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher. * @param {ClientSession} [options.session] optional session to use for this operation @@ -760,12 +760,12 @@ Collection.prototype.replaceOne = function(filter, doc, options, callback) { * @method * @param {object} filter The Filter used to select the documents to update * @param {object} update The update operations to be applied to the document - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.upsert=false] Update operation is an upsert. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. - * @param {Array} [options.arrayFilters=null] optional list of array filters referenced in filtered positional operators + * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~updateWriteOpCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -796,15 +796,15 @@ Collection.prototype.updateMany = function(filter, update, options, callback) { * @method * @param {object} selector The selector for the update operation. * @param {object} document The update document. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.upsert=false] Update operation is an upsert. * @param {boolean} [options.multi=false] Update one/all documents with operation. * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher. - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). - * @param {Array} [options.arrayFilters=null] optional list of array filters referenced in filtered positional operators + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~writeOpCallback} [callback] The command result callback * @throws {MongoError} @@ -850,9 +850,9 @@ Collection.prototype.update = function(selector, document, options, callback) { * Delete a document on MongoDB * @method * @param {object} filter The Filter used to select the document to remove - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~deleteWriteOpCallback} [callback] The command result callback @@ -877,9 +877,9 @@ Collection.prototype.removeOne = Collection.prototype.deleteOne; * Delete multiple documents on MongoDB * @method * @param {object} filter The Filter used to select the documents to remove - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~deleteWriteOpCallback} [callback] The command result callback @@ -904,9 +904,9 @@ Collection.prototype.removeMany = Collection.prototype.deleteMany; * Remove documents. * @method * @param {object} selector The selector for the update operation. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.single=false] Removes the first document found. * @param {ClientSession} [options.session] optional session to use for this operation @@ -932,9 +932,9 @@ Collection.prototype.remove = function(selector, options, callback) { * operators and update instead for more efficient operations. * @method * @param {object} doc Document to save - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~writeOpCallback} [callback] The command result callback @@ -972,32 +972,32 @@ Collection.prototype.save = function(doc, options, callback) { * Fetches the first document that matches the query * @method * @param {object} query Query for find Operation - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {number} [options.limit=0] Sets the limit of documents returned in the query. - * @param {(array|object)} [options.sort=null] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc. - * @param {object} [options.projection=null] The fields to return in the query. Object of fields to include or exclude (not both), {'a':1} - * @param {object} [options.fields=null] **Deprecated** Use `options.projection` instead + * @param {(array|object)} [options.sort] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc. + * @param {object} [options.projection] The fields to return in the query. Object of fields to include or exclude (not both), {'a':1} + * @param {object} [options.fields] **Deprecated** Use `options.projection` instead * @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination). - * @param {Object} [options.hint=null] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1} + * @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1} * @param {boolean} [options.explain=false] Explain the query instead of returning the data. * @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query. * @param {boolean} [options.timeout=false] Specify if the cursor can timeout. * @param {boolean} [options.tailable=false] Specify if the cursor is tailable. * @param {number} [options.batchSize=0] Set the batchSize for the getMoreCommand when iterating over the query results. * @param {boolean} [options.returnKey=false] Only return the index key. - * @param {number} [options.maxScan=null] DEPRECATED: Limit the number of items to scan. - * @param {number} [options.min=null] Set index bounds. - * @param {number} [options.max=null] Set index bounds. + * @param {number} [options.maxScan] DEPRECATED: Limit the number of items to scan. + * @param {number} [options.min] Set index bounds. + * @param {number} [options.max] Set index bounds. * @param {boolean} [options.showDiskLoc=false] Show disk location of results. - * @param {string} [options.comment=null] You can put a $comment field on a query to make looking in the profiler logs simpler. + * @param {string} [options.comment] You can put a $comment field on a query to make looking in the profiler logs simpler. * @param {boolean} [options.raw=false] Return document results as raw BSON buffers. * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution. * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system - * @param {number} [options.maxTimeMS=null] Number of miliseconds to wait before aborting the query. - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1023,7 +1023,7 @@ Collection.prototype.findOne = function(query, options, callback) { * * @method * @param {string} newName New name of of the collection. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.dropTarget=false] Drop the target name collection if it previously exists. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~collectionResultCallback} [callback] The results callback @@ -1040,7 +1040,7 @@ Collection.prototype.rename = function(newName, options, callback) { * Drop the collection from the database, removing it permanently. New accesses will create a new collection. * * @method - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The results callback * @return {Promise} returns Promise if no callback passed @@ -1092,21 +1092,21 @@ Collection.prototype.isCapped = function(options, callback) { * Creates an index on the db and collection collection. * @method * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.unique=false] Creates an unique index. * @param {boolean} [options.sparse=false] Creates a sparse index. * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible. * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value - * @param {number} [options.min=null] For geospatial indexes set the lower bound for the co-ordinates. - * @param {number} [options.max=null] For geospatial indexes set the high bound for the co-ordinates. - * @param {number} [options.v=null] Specify the format version of the indexes. - * @param {number} [options.expireAfterSeconds=null] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) - * @param {string} [options.name=null] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) - * @param {object} [options.partialFilterExpression=null] Creates a partial index based on the given filter object (MongoDB 3.2 or higher) - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates. + * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates. + * @param {number} [options.v] Specify the format version of the indexes. + * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) + * @param {string} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) + * @param {object} [options.partialFilterExpression] Creates a partial index based on the given filter object (MongoDB 3.2 or higher) + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1142,9 +1142,9 @@ Collection.prototype.createIndexes = function(indexSpecs, options, callback) { * Drops an index from this collection. * @method * @param {string} indexName Name of the index to drop. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. @@ -1209,9 +1209,9 @@ Collection.prototype.reIndex = function(options, callback) { * Get the list of all indexes information for the collection. * * @method - * @param {object} [options=null] Optional settings. - * @param {number} [options.batchSize=null] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options] Optional settings. + * @param {number} [options.batchSize] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @return {CommandCursor} */ @@ -1262,20 +1262,20 @@ Collection.prototype.listIndexes = function(options) { * @method * @deprecated use createIndexes instead * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.unique=false] Creates an unique index. * @param {boolean} [options.sparse=false] Creates a sparse index. * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible. * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value - * @param {number} [options.min=null] For geospatial indexes set the lower bound for the co-ordinates. - * @param {number} [options.max=null] For geospatial indexes set the high bound for the co-ordinates. - * @param {number} [options.v=null] Specify the format version of the indexes. - * @param {number} [options.expireAfterSeconds=null] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) - * @param {number} [options.name=null] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates. + * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates. + * @param {number} [options.v] Specify the format version of the indexes. + * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) + * @param {number} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1306,7 +1306,7 @@ Collection.prototype.indexExists = function(indexes, options, callback) { /** * Retrieves this collections index info. * @method - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.full=false] Returns the full raw index information. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback @@ -1331,12 +1331,12 @@ Collection.prototype.indexInformation = function(options, callback) { * Count number of matching documents in the db to a query. * @method * @param {object} [query={}] The query for the count. - * @param {object} [options=null] Optional settings. - * @param {boolean} [options.limit=null] The limit of documents to count. - * @param {boolean} [options.skip=null] The number of documents to skip for the count. - * @param {string} [options.hint=null] An index name hint for the query. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {number} [options.maxTimeMS=null] Number of miliseconds to wait before aborting the query. + * @param {object} [options] Optional settings. + * @param {boolean} [options.limit] The limit of documents to count. + * @param {boolean} [options.skip] The number of documents to skip for the count. + * @param {string} [options.hint] An index name hint for the query. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~countCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1433,9 +1433,9 @@ Collection.prototype.countDocuments = function(query, options, callback) { * @method * @param {string} key Field of the document to find distinct values for. * @param {object} query The query for filtering the set of documents to which we apply the distinct filter. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {number} [options.maxTimeMS=null] Number of miliseconds to wait before aborting the query. + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1474,8 +1474,8 @@ Collection.prototype.indexes = function(options, callback) { * Get all the collection statistics. * * @method - * @param {object} [options=null] Optional settings. - * @param {number} [options.scale=null] Divide the returned sizes by scale value. + * @param {object} [options] Optional settings. + * @param {number} [options.scale] Divide the returned sizes by scale value. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The collection result callback * @return {Promise} returns Promise if no callback passed @@ -1507,10 +1507,10 @@ Collection.prototype.stats = function(options, callback) { * * @method * @param {object} filter Document selection filter. - * @param {object} [options=null] Optional settings. - * @param {object} [options.projection=null] Limits the fields to return for all matching documents. - * @param {object} [options.sort=null] Determines which document the operation modifies if the query selects multiple documents. - * @param {number} [options.maxTimeMS=null] The maximum amount of time to allow the query to run. + * @param {object} [options] Optional settings. + * @param {object} [options.projection] Limits the fields to return for all matching documents. + * @param {object} [options.sort] Determines which document the operation modifies if the query selects multiple documents. + * @param {number} [options.maxTimeMS] The maximum amount of time to allow the query to run. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~findAndModifyCallback} [callback] The collection result callback * @return {Promise} returns Promise if no callback passed @@ -1532,10 +1532,10 @@ Collection.prototype.findOneAndDelete = function(filter, options, callback) { * @method * @param {object} filter Document selection filter. * @param {object} replacement Document replacing the matching document. - * @param {object} [options=null] Optional settings. - * @param {object} [options.projection=null] Limits the fields to return for all matching documents. - * @param {object} [options.sort=null] Determines which document the operation modifies if the query selects multiple documents. - * @param {number} [options.maxTimeMS=null] The maximum amount of time to allow the query to run. + * @param {object} [options] Optional settings. + * @param {object} [options.projection] Limits the fields to return for all matching documents. + * @param {object} [options.sort] Determines which document the operation modifies if the query selects multiple documents. + * @param {number} [options.maxTimeMS] The maximum amount of time to allow the query to run. * @param {boolean} [options.upsert=false] Upsert the document if it does not exist. * @param {boolean} [options.returnOriginal=true] When false, returns the updated document rather than the original. The default is true. * @param {ClientSession} [options.session] optional session to use for this operation @@ -1651,9 +1651,9 @@ Collection.prototype.findAndModify = function(query, sort, doc, options, callbac * @method * @param {object} query Query object to locate the object to modify. * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback @@ -1673,19 +1673,19 @@ Collection.prototype.findAndRemove = function(query, sort, options, callback) { * Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2 * @method * @param {object} pipeline Array containing all the aggregation framework commands for the execution. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.cursor=null] Return the query as cursor, on 2.6 > it returns as a real cursor on pre 2.6 it returns as an emulated cursor. - * @param {number} [options.cursor.batchSize=null] The batchSize for the cursor + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @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. + * @param {number} [options.cursor.batchSize] The batchSize for the cursor * @param {boolean} [options.explain=false] Explain returns the aggregation execution plan (requires mongodb 2.6 >). * @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 >). - * @param {number} [options.maxTimeMS=null] maxTimeMS specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point. + * @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. * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher. * @param {boolean} [options.raw=false] Return document results as raw BSON buffers. * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution. * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {string} [options.comment] Add a comment to an aggregation command * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~aggregationCallback} callback The command result callback @@ -1855,9 +1855,9 @@ Collection.prototype.watch = function(pipeline, options) { * Return N number of parallel cursors for a collection allowing parallel reading of entire collection. There are * no ordering guarantees for returned results. * @method - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {number} [options.batchSize=null] Set the batchSize for the getMoreCommand when iterating over the query results. + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.batchSize] Set the batchSize for the getMoreCommand when iterating over the query results. * @param {number} [options.numCursors=1] The maximum number of parallel command cursors to return (the number of returned cursors will be in the range 1:numCursors) * @param {boolean} [options.raw=false] Return all BSON documents as Raw Buffer documents. * @param {Collection~parallelCollectionScanCallback} [callback] The command result callback @@ -1891,10 +1891,10 @@ Collection.prototype.parallelCollectionScan = function(options, callback) { * @method * @param {number} x Point to search on the x axis, ensure the indexes are ordered in the same order. * @param {number} y Point to search on the y axis, ensure the indexes are ordered in the same order. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {number} [options.maxDistance=null] Include results up to maxDistance from the point. - * @param {object} [options.search=null] Filter the results by a query. + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.maxDistance] Include results up to maxDistance from the point. + * @param {object} [options.search] Filter the results by a query. * @param {number} [options.limit=false] Max number of results to return. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback @@ -1918,8 +1918,8 @@ Collection.prototype.geoHaystackSearch = function(x, y, options, callback) { * @param {(function|Code)} reduce The reduce function aggregates (reduces) the objects iterated * @param {(function|Code)} finalize An optional function to be run on each item in the result set just before the item is returned. * @param {boolean} command Specify if you wish to run using the internal group command or using eval, default is true. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Collection~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -1987,15 +1987,15 @@ Collection.prototype.group = function( * @method * @param {(function|string)} map The mapping function. * @param {(function|string)} reduce The reduce function. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.out=null] Sets the output target for the map reduce job. *{inline:1} | {replace:'collectionName'} | {merge:'collectionName'} | {reduce:'collectionName'}* - * @param {object} [options.query=null] Query filter object. - * @param {object} [options.sort=null] Sorts the input objects using this key. Useful for optimization, like sorting by the emit key for fewer reduces. - * @param {number} [options.limit=null] Number of objects to return from collection. + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.out] Sets the output target for the map reduce job. *{inline:1} | {replace:'collectionName'} | {merge:'collectionName'} | {reduce:'collectionName'}* + * @param {object} [options.query] Query filter object. + * @param {object} [options.sort] Sorts the input objects using this key. Useful for optimization, like sorting by the emit key for fewer reduces. + * @param {number} [options.limit] Number of objects to return from collection. * @param {boolean} [options.keeptemp=false] Keep temporary data. - * @param {(function|string)} [options.finalize=null] Finalize function. - * @param {object} [options.scope=null] Can pass in variables that can be access from map/reduce/finalize. + * @param {(function|string)} [options.finalize] Finalize function. + * @param {object} [options.scope] Can pass in variables that can be access from map/reduce/finalize. * @param {boolean} [options.jsMode=false] It is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X. * @param {boolean} [options.verbose=false] Provide statistics on job execution time. * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher. @@ -2032,9 +2032,9 @@ Collection.prototype.mapReduce = function(map, reduce, options, callback) { * Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. * * @method - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @return {UnorderedBulkOperation} @@ -2049,9 +2049,9 @@ Collection.prototype.initializeUnorderedBulkOp = function(options) { * Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types. * * @method - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {OrderedBulkOperation} callback The command result callback diff --git a/lib/cursor.js b/lib/cursor.js index 5222663376..3e7addd2d6 100644 --- a/lib/cursor.js +++ b/lib/cursor.js @@ -831,12 +831,12 @@ Cursor.prototype.toArray = function(callback) { * Get the count of documents for this cursor * @method * @param {boolean} [applySkipLimit=true] Should the count command apply limit and skip settings on the cursor or in the passed in options. - * @param {object} [options=null] Optional settings. - * @param {number} [options.skip=null] The number of documents to skip. - * @param {number} [options.limit=null] The maximum amounts to count before aborting. - * @param {number} [options.maxTimeMS=null] Number of miliseconds to wait before aborting the query. - * @param {string} [options.hint=null] An index name hint for the query. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options] Optional settings. + * @param {number} [options.skip] The number of documents to skip. + * @param {number} [options.limit] The maximum amounts to count before aborting. + * @param {number} [options.maxTimeMS] Number of miliseconds to wait before aborting the query. + * @param {string} [options.hint] An index name hint for the query. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {Cursor~countResultCallback} [callback] The result callback. * @return {Promise} returns Promise if no callback passed */ diff --git a/lib/db.js b/lib/db.js index 9f84534182..dbe9f58087 100644 --- a/lib/db.js +++ b/lib/db.js @@ -92,10 +92,10 @@ const legalOptionNames = [ * @class * @param {string} databaseName The name of the database this instance represents. * @param {(Server|ReplSet|Mongos)} topology The server topology for the database. - * @param {object} [options=null] Optional settings. - * @param {string} [options.authSource=null] If the database authentication is dependent on another databaseName. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {string} [options.authSource] If the database authentication is dependent on another databaseName. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver. * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. @@ -105,10 +105,10 @@ const legalOptionNames = [ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers. * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types. * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.pkFactory=null] A primary key factory object for generation of custom _id keys. - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {object} [options.readConcern=null] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys. + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) * @param {object} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported) * @property {(Server|ReplSet|Mongos)} serverConfig Get the current db topology. * @property {number} bufferMaxEntries Current bufferMaxEntries value for the database @@ -247,8 +247,8 @@ Object.defineProperty(Db.prototype, 'writeConcern', { * Execute a command * @method * @param {object} command The command hash - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -296,16 +296,16 @@ const collectionKeys = [ * * @method * @param {string} name the collection name we wish to access. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.raw=false] Return document results as raw BSON buffers. - * @param {object} [options.pkFactory=null] A primary key factory object for generation of custom _id keys. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.strict=false] Returns an error if the collection does not exist - * @param {object} [options.readConcern=null] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) + * @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) * @param {object} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported) * @param {Db~collectionResultCallback} [callback] The collection result callback * @return {Collection} return the new Collection instance if not in strict mode @@ -388,28 +388,28 @@ Db.prototype.collection = function(name, options, callback) { * * @method * @param {string} name the collection name we wish to access. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.raw=false] Return document results as raw BSON buffers. - * @param {object} [options.pkFactory=null] A primary key factory object for generation of custom _id keys. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object. * @param {boolean} [options.strict=false] Returns an error if the collection does not exist * @param {boolean} [options.capped=false] Create a capped collection. * @param {boolean} [options.autoIndexId=true] DEPRECATED: Create an index on the _id field of the document, True by default on MongoDB 2.6 - 3.0 - * @param {number} [options.size=null] The size of the capped collection in bytes. - * @param {number} [options.max=null] The maximum number of documents in the capped collection. - * @param {number} [options.flags=null] Optional. Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag. - * @param {object} [options.storageEngine=null] Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher. - * @param {object} [options.validator=null] Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher. - * @param {string} [options.validationLevel=null] Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher. - * @param {string} [options.validationAction=null] Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher. - * @param {object} [options.indexOptionDefaults=null] Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher. - * @param {string} [options.viewOn=null] The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher. - * @param {array} [options.pipeline=null] An array that consists of the aggregation pipeline stage. create creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher. - * @param {object} [options.collation=null] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + * @param {number} [options.size] The size of the capped collection in bytes. + * @param {number} [options.max] The maximum number of documents in the capped collection. + * @param {number} [options.flags] Optional. Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag. + * @param {object} [options.storageEngine] Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher. + * @param {object} [options.validator] Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher. + * @param {string} [options.validationLevel] Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher. + * @param {string} [options.validationAction] Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher. + * @param {object} [options.indexOptionDefaults] Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher. + * @param {string} [options.viewOn] The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher. + * @param {array} [options.pipeline] An array that consists of the aggregation pipeline stage. create creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher. + * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~collectionResultCallback} [callback] The results callback * @return {Promise} returns Promise if no callback passed @@ -430,8 +430,8 @@ Db.prototype.createCollection = function(name, options, callback) { * Get all the db statistics. * * @method - * @param {object} [options=null] Optional settings. - * @param {number} [options.scale=null] Divide the returned sizes by scale value. + * @param {object} [options] Optional settings. + * @param {number} [options.scale] Divide the returned sizes by scale value. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The collection result callback * @return {Promise} returns Promise if no callback passed @@ -458,10 +458,10 @@ Db.prototype.stats = function(options, callback) { * * @method * @param {object} [filter={}] Query to filter collections by - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.nameOnly=false] Since 4.0: If true, will only return the collection name in the response, and will omit additional info - * @param {number} [options.batchSize=null] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {number} [options.batchSize] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @return {CommandCursor} */ @@ -542,7 +542,7 @@ Db.prototype.listCollections = function(filter, options) { * @method * @param {Code} code JavaScript to execute on server. * @param {(object|array)} parameters The parameters for the call. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.nolock=false] Tell MongoDB not to block on the evaulation of the javascript. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The results callback @@ -564,7 +564,7 @@ Db.prototype.eval = function(code, parameters, options, callback) { * @method * @param {string} fromCollection Name of current collection to rename. * @param {string} toCollection New name of of the collection. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.dropTarget=false] Drop the target name collection if it previously exists. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~collectionResultCallback} [callback] The results callback @@ -661,8 +661,8 @@ Db.prototype.collections = function(options, callback) { * Runs a command on the database as admin. * @method * @param {object} command The command hash - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -685,20 +685,20 @@ Db.prototype.executeDbAdminCommand = function(selector, options, callback) { * @method * @param {string} name Name of the collection to create the index on. * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.unique=false] Creates an unique index. * @param {boolean} [options.sparse=false] Creates a sparse index. * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible. * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value - * @param {number} [options.min=null] For geospatial indexes set the lower bound for the co-ordinates. - * @param {number} [options.max=null] For geospatial indexes set the high bound for the co-ordinates. - * @param {number} [options.v=null] Specify the format version of the indexes. - * @param {number} [options.expireAfterSeconds=null] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) - * @param {number} [options.name=null] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) - * @param {object} [options.partialFilterExpression=null] Creates a partial index based on the given filter object (MongoDB 3.2 or higher) + * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates. + * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates. + * @param {number} [options.v] Specify the format version of the indexes. + * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) + * @param {number} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) + * @param {object} [options.partialFilterExpression] Creates a partial index based on the given filter object (MongoDB 3.2 or higher) * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -722,19 +722,19 @@ Db.prototype.createIndex = function(name, fieldOrSpec, options, callback) { * @deprecated since version 2.0 * @param {string} name The index name * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.unique=false] Creates an unique index. * @param {boolean} [options.sparse=false] Creates a sparse index. * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible. * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value - * @param {number} [options.min=null] For geospatial indexes set the lower bound for the co-ordinates. - * @param {number} [options.max=null] For geospatial indexes set the high bound for the co-ordinates. - * @param {number} [options.v=null] Specify the format version of the indexes. - * @param {number} [options.expireAfterSeconds=null] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) - * @param {number} [options.name=null] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) + * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates. + * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates. + * @param {number} [options.v] Specify the format version of the indexes. + * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) + * @param {number} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -762,12 +762,12 @@ Db.prototype.addChild = function(db) { * @method * @param {string} username The username. * @param {string} password The password. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. - * @param {object} [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher) - * @param {object[]} [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher) + * @param {object} [options.customData] Custom data associated with the user (only Mongodb 2.6 or higher) + * @param {object[]} [options.roles] Roles associated with the created user (only Mongodb 2.6 or higher) * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed @@ -783,9 +783,9 @@ Db.prototype.addUser = function(username, password, options, callback) { * Remove a user from a database * @method * @param {string} username The username. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback @@ -849,9 +849,9 @@ Db.prototype.profilingLevel = function(options, callback) { * Retrieves this collections index info. * @method * @param {string} name The name of the collection. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.full=false] Returns the full raw index information. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @param {ClientSession} [options.session] optional session to use for this operation * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed diff --git a/lib/gridfs-stream/download.js b/lib/gridfs-stream/download.js index 87db72b27d..9012602670 100644 --- a/lib/gridfs-stream/download.js +++ b/lib/gridfs-stream/download.js @@ -15,11 +15,11 @@ module.exports = GridFSBucketReadStream; * @param {Collection} files Handle for files collection * @param {Object} readPreference The read preference to use * @param {Object} filter The query to use to find the file document - * @param {Object} [options=null] Optional settings. - * @param {Number} [options.sort=null] Optional sort for the file find query - * @param {Number} [options.skip=null] Optional skip for the file find query - * @param {Number} [options.start=null] Optional 0-based offset in bytes to start streaming from - * @param {Number} [options.end=null] Optional 0-based offset in bytes to stop streaming before + * @param {Object} [options] Optional settings. + * @param {Number} [options.sort] Optional sort for the file find query + * @param {Number} [options.skip] Optional skip for the file find query + * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from + * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before * @fires GridFSBucketReadStream#error * @fires GridFSBucketReadStream#file * @return {GridFSBucketReadStream} a GridFSBucketReadStream instance. diff --git a/lib/gridfs-stream/index.js b/lib/gridfs-stream/index.js index c14fb540bd..ef16e14898 100644 --- a/lib/gridfs-stream/index.js +++ b/lib/gridfs-stream/index.js @@ -19,11 +19,11 @@ module.exports = GridFSBucket; * Constructor for a streaming GridFS interface * @class * @param {Db} db A db handle - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {string} [options.bucketName="fs"] The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. * @param {number} [options.chunkSizeBytes=255 * 1024] Number of bytes stored in each chunk. Defaults to 255KB - * @param {object} [options.writeConcern=null] Optional write concern to be passed to write operations, for instance `{ w: 1 }` - * @param {object} [options.readPreference=null] Optional read preference to be passed to read operations + * @param {object} [options.writeConcern] Optional write concern to be passed to write operations, for instance `{ w: 1 }` + * @param {object} [options.readPreference] Optional read preference to be passed to read operations * @fires GridFSBucketWriteStream#index * @return {GridFSBucket} */ @@ -74,11 +74,11 @@ util.inherits(GridFSBucket, Emitter); * file's id. * @method * @param {string} filename The value of the 'filename' key in the files doc - * @param {object} [options=null] Optional settings. - * @param {number} [options.chunkSizeBytes=null] Optional overwrite this bucket's chunkSizeBytes for this file - * @param {object} [options.metadata=null] Optional object to store in the file document's `metadata` field - * @param {string} [options.contentType=null] Optional string to store in the file document's `contentType` field - * @param {array} [options.aliases=null] Optional array of strings to store in the file document's `aliases` field + * @param {object} [options] Optional settings. + * @param {number} [options.chunkSizeBytes] Optional overwrite this bucket's chunkSizeBytes for this file + * @param {object} [options.metadata] Optional object to store in the file document's `metadata` field + * @param {string} [options.contentType] Optional string to store in the file document's `contentType` field + * @param {array} [options.aliases] Optional array of strings to store in the file document's `aliases` field * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data * @return {GridFSBucketWriteStream} */ @@ -102,11 +102,11 @@ GridFSBucket.prototype.openUploadStream = function(filename, options) { * @method * @param {string|number|object} id A custom id used to identify the file * @param {string} filename The value of the 'filename' key in the files doc - * @param {object} [options=null] Optional settings. - * @param {number} [options.chunkSizeBytes=null] Optional overwrite this bucket's chunkSizeBytes for this file - * @param {object} [options.metadata=null] Optional object to store in the file document's `metadata` field - * @param {string} [options.contentType=null] Optional string to store in the file document's `contentType` field - * @param {array} [options.aliases=null] Optional array of strings to store in the file document's `aliases` field + * @param {object} [options] Optional settings. + * @param {number} [options.chunkSizeBytes] Optional overwrite this bucket's chunkSizeBytes for this file + * @param {object} [options.metadata] Optional object to store in the file document's `metadata` field + * @param {string} [options.contentType] Optional string to store in the file document's `contentType` field + * @param {array} [options.aliases] Optional array of strings to store in the file document's `aliases` field * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data * @return {GridFSBucketWriteStream} */ @@ -132,9 +132,9 @@ GridFSBucket.prototype.openUploadStreamWithId = function(id, filename, options) * data from GridFS. * @method * @param {ObjectId} id The id of the file doc - * @param {Object} [options=null] Optional settings. - * @param {Number} [options.start=null] Optional 0-based offset in bytes to start streaming from - * @param {Number} [options.end=null] Optional 0-based offset in bytes to stop streaming before + * @param {Object} [options] Optional settings. + * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from + * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before * @return {GridFSBucketReadStream} */ @@ -197,13 +197,13 @@ function _delete(_this, id, callback) { * Convenience wrapper around find on the files collection * @method * @param {Object} filter - * @param {Object} [options=null] Optional settings for cursor - * @param {number} [options.batchSize=null] Optional batch size for cursor - * @param {number} [options.limit=null] Optional limit for cursor - * @param {number} [options.maxTimeMS=null] Optional maxTimeMS for cursor - * @param {boolean} [options.noCursorTimeout=null] Optionally set cursor's `noCursorTimeout` flag - * @param {number} [options.skip=null] Optional skip for cursor - * @param {object} [options.sort=null] Optional sort for cursor + * @param {Object} [options] Optional settings for cursor + * @param {number} [options.batchSize] Optional batch size for cursor + * @param {number} [options.limit] Optional limit for cursor + * @param {number} [options.maxTimeMS] Optional maxTimeMS for cursor + * @param {boolean} [options.noCursorTimeout] Optionally set cursor's `noCursorTimeout` flag + * @param {number} [options.skip] Optional skip for cursor + * @param {object} [options.sort] Optional sort for cursor * @return {Cursor} */ @@ -243,10 +243,10 @@ GridFSBucket.prototype.find = function(filter, options) { * option to change this behavior. * @method * @param {String} filename The name of the file to stream - * @param {Object} [options=null] Optional settings + * @param {Object} [options] Optional settings * @param {number} [options.revision=-1] The revision number relative to the oldest file with the given filename. 0 gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the newest. - * @param {Number} [options.start=null] Optional 0-based offset in bytes to start streaming from - * @param {Number} [options.end=null] Optional 0-based offset in bytes to stop streaming before + * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from + * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before * @return {GridFSBucketReadStream} */ diff --git a/lib/gridfs-stream/upload.js b/lib/gridfs-stream/upload.js index 5c67aea7a9..c213302795 100644 --- a/lib/gridfs-stream/upload.js +++ b/lib/gridfs-stream/upload.js @@ -17,12 +17,12 @@ module.exports = GridFSBucketWriteStream; * @class * @param {GridFSBucket} bucket Handle for this stream's corresponding bucket * @param {string} filename The value of the 'filename' key in the files doc - * @param {object} [options=null] Optional settings. - * @param {string|number|object} [options.id=null] Custom file id for the GridFS file. - * @param {number} [options.chunkSizeBytes=null] The chunk size to use, in bytes - * @param {number} [options.w=null] The write concern - * @param {number} [options.wtimeout=null] The write concern timeout - * @param {number} [options.j=null] The journal write concern + * @param {object} [options] Optional settings. + * @param {string|number|object} [options.id] Custom file id for the GridFS file. + * @param {number} [options.chunkSizeBytes] The chunk size to use, in bytes + * @param {number} [options.w] The write concern + * @param {number} [options.wtimeout] The write concern timeout + * @param {number} [options.j] The journal write concern * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data * @fires GridFSBucketWriteStream#error * @fires GridFSBucketWriteStream#finish diff --git a/lib/gridfs/grid_store.js b/lib/gridfs/grid_store.js index dbabefcd56..0414dd2865 100644 --- a/lib/gridfs/grid_store.js +++ b/lib/gridfs/grid_store.js @@ -72,17 +72,17 @@ const deprecationFn = deprecate(() => {}, * @param {object} [id] optional unique id for this file * @param {string} [filename] optional filename for this file, no unique constrain on the field * @param {string} mode set the mode for this file. - * @param {object} [options=null] Optional settings. - * @param {(number|string)} [options.w=null] The write concern. - * @param {number} [options.wtimeout=null] The write concern timeout. + * @param {object} [options] Optional settings. + * @param {(number|string)} [options.w] The write concern. + * @param {number} [options.wtimeout] The write concern timeout. * @param {boolean} [options.j=false] Specify a journal write concern. * @param {boolean} [options.fsync=false] Specify a file sync write concern. - * @param {string} [options.root=null] Root collection to use. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**. - * @param {string} [options.content_type=null] MIME type of the file. Defaults to **{GridStore.DEFAULT_CONTENT_TYPE}**. + * @param {string} [options.root] Root collection to use. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**. + * @param {string} [options.content_type] MIME type of the file. Defaults to **{GridStore.DEFAULT_CONTENT_TYPE}**. * @param {number} [options.chunk_size=261120] Size for the chunk. Defaults to **{Chunk.DEFAULT_CHUNK_SIZE}**. - * @param {object} [options.metadata=null] Arbitrary data the user wants to store. - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.metadata] Arbitrary data the user wants to store. + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). * @property {number} chunkSize Get the gridstore chunk size. * @property {number} md5 The md5 checksum for this file. * @property {number} chunkNumber The current chunk number the gridstore has materialized into memory @@ -1270,9 +1270,9 @@ GridStore.IO_SEEK_END = 2; * @param {Db} db the database to query. * @param {string} name The name of the file to look for. * @param {string} [rootCollection] The root collection that holds the files and chunks collection. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] result from exists. * @return {Promise} returns Promise if no callback passed @@ -1333,9 +1333,9 @@ var exists = function(db, fileIdObject, rootCollection, options, callback) { * @static * @param {Db} db the database to query. * @param {string} [rootCollection] The root collection that holds the files and chunks collection. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] result from exists. * @return {Promise} returns Promise if no callback passed @@ -1401,9 +1401,9 @@ var list = function(db, rootCollection, options, callback) { * @param {string} name The name of the file. * @param {number} [length] The size of data to read. * @param {number} [offset] The offset from the head of the file of which to start reading from. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed @@ -1455,9 +1455,9 @@ var readStatic = function(db, name, length, offset, options, callback) { * @param {Db} db the database to query. * @param {(String|object)} name the name of the file. * @param {string} [separator] The character to be recognized as the newline separator. - * @param {object} [options=null] Optional settings. - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options] Optional settings. + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~readlinesCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed @@ -1493,8 +1493,8 @@ var readlinesStatic = function(db, name, separator, options, callback) { * @static * @param {Db} db The database to query. * @param {(string|array)} names The name/names of the files to delete. - * @param {object} [options=null] Optional settings. - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options] Optional settings. + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible * @param {ClientSession} [options.session] optional session to use for this operation * @param {GridStore~resultCallback} [callback] the command callback. * @return {Promise} returns Promise if no callback passed diff --git a/lib/mongo_client.js b/lib/mongo_client.js index 2e369817dc..a262f8ba06 100644 --- a/lib/mongo_client.js +++ b/lib/mongo_client.js @@ -64,7 +64,7 @@ const validOptions = require('./operations/mongo_client_ops').validOptions; * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled * @param {number} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket * @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting - * @param {number} [options.family=null] Version of IP stack. Can be 4, 6 or null (default). + * @param {number} [options.family] Version of IP stack. Can be 4, 6 or null (default). * If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure * @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times @@ -76,18 +76,18 @@ const validOptions = require('./operations/mongo_client_ops').validOptions; * @param {number} [options.acceptableLatencyMS=15] Cutoff latency point in MS for Mongos proxies selection * @param {boolean} [options.connectWithNoPrimary=false] Sets if the driver should connect even if no primary is available * @param {string} [options.authSource=undefined] Define the database to authenticate against - * @param {(number|string)} [options.w=null] The write concern - * @param {number} [options.wtimeout=null] The write concern timeout + * @param {(number|string)} [options.w] The write concern + * @param {number} [options.wtimeout] The write concern timeout * @param {boolean} [options.j=false] Specify a journal write concern * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields * @param {boolean} [options.raw=false] Return document results as raw BSON buffers * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) - * @param {object} [options.pkFactory=null] A primary key factory object for generation of custom _id keys - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {object} [options.readConcern=null] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) + * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) * @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported) * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed) * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug) @@ -102,9 +102,9 @@ const validOptions = require('./operations/mongo_client_ops').validOptions; * @param {string} [options.auth.user=undefined] The username for auth * @param {string} [options.auth.password=undefined] The password for auth * @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, or SCRAM-SHA-1 - * @param {object} [options.compression=null] Type of compression to use: snappy or zlib + * @param {object} [options.compression] Type of compression to use: snappy or zlib * @param {boolean} [options.fsync=false] Specify a file sync write concern - * @param {array} [options.readPreferenceTags=null] Read preference tags + * @param {array} [options.readPreferenceTags] Read preference tags * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor * @param {boolean} [options.auto_reconnect=true] Enable auto reconnecting for single server instances * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this client @@ -173,8 +173,8 @@ MongoClient.prototype.connect = function(callback) { /** * Logout user from server, fire off on all connections and remove all auth info * @method - * @param {object} [options=null] Optional settings. - * @param {string} [options.dbName=null] Logout against different database than current. + * @param {object} [options] Optional settings. + * @param {string} [options.dbName] Logout against different database than current. * @param {Db~resultCallback} [callback] The command result callback * @return {Promise} returns Promise if no callback passed */ @@ -234,7 +234,7 @@ MongoClient.prototype.close = function(force, callback) { * * @method * @param {string} [dbName] The name of the database we want to use. If not provided, use database name from connection string. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.noListener=false] Do not make the db an event listener to the original connection. * @param {boolean} [options.returnNonCachedInstance=false] Control if you want to return a cached instance or have a new one created * @return {Db} @@ -276,7 +276,7 @@ MongoClient.prototype.db = function(dbName, options) { * Check if MongoClient is connected * * @method - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.noListener=false] Do not make the db an event listener to the original connection. * @param {boolean} [options.returnNonCachedInstance=false] Control if you want to return a cached instance or have a new one created * @return {boolean} @@ -312,7 +312,7 @@ MongoClient.prototype.isConnected = function(options) { * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled * @param {boolean} [options.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket * @param {number} [options.connectTimeoutMS=30000] TCP Connection timeout setting - * @param {number} [options.family=null] Version of IP stack. Can be 4, 6 or null (default). + * @param {number} [options.family] Version of IP stack. Can be 4, 6 or null (default). * If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure * @param {number} [options.socketTimeoutMS=360000] TCP Socket timeout setting * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times @@ -324,18 +324,18 @@ MongoClient.prototype.isConnected = function(options) { * @param {number} [options.acceptableLatencyMS=15] Cutoff latency point in MS for Mongos proxies selection * @param {boolean} [options.connectWithNoPrimary=false] Sets if the driver should connect even if no primary is available * @param {string} [options.authSource=undefined] Define the database to authenticate against - * @param {(number|string)} [options.w=null] The write concern - * @param {number} [options.wtimeout=null] The write concern timeout + * @param {(number|string)} [options.w] The write concern + * @param {number} [options.wtimeout] The write concern timeout * @param {boolean} [options.j=false] Specify a journal write concern * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields * @param {boolean} [options.raw=false] Return document results as raw BSON buffers * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited - * @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) - * @param {object} [options.pkFactory=null] A primary key factory object for generation of custom _id keys - * @param {object} [options.promiseLibrary=null] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {object} [options.readConcern=null] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) + * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) + * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys + * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) * @param {string} [options.readConcern.level='local'] Specify a read concern level for the collection operations, one of [local|majority]. (only MongoDB 3.2 or higher supported) * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed) * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug) @@ -350,9 +350,9 @@ MongoClient.prototype.isConnected = function(options) { * @param {string} [options.auth.user=undefined] The username for auth * @param {string} [options.auth.password=undefined] The password for auth * @param {string} [options.authMechanism=undefined] Mechanism for authentication: MDEFAULT, GSSAPI, PLAIN, MONGODB-X509, or SCRAM-SHA-1 - * @param {object} [options.compression=null] Type of compression to use: snappy or zlib + * @param {object} [options.compression] Type of compression to use: snappy or zlib * @param {boolean} [options.fsync=false] Specify a file sync write concern - * @param {array} [options.readPreferenceTags=null] Read preference tags + * @param {array} [options.readPreferenceTags] Read preference tags * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor * @param {boolean} [options.auto_reconnect=true] Enable auto reconnecting for single server instances * @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections diff --git a/lib/operations/collection_ops.js b/lib/operations/collection_ops.js index fa6864ee7c..9b67d9e5e3 100644 --- a/lib/operations/collection_ops.js +++ b/lib/operations/collection_ops.js @@ -61,7 +61,7 @@ const groupFunction = * @method * @param {Collection} a Collection instance. * @param {object[]} operations Bulk operations to perform. - * @param {object} [options=null] Optional settings. See Collection.prototype.bulkWrite for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.bulkWrite for a list of options. * @param {Collection~bulkWriteOpCallback} [callback] The command result callback */ function bulkWrite(coll, operations, options, callback) { @@ -169,7 +169,7 @@ function checkForAtomicOperators(update) { * @method * @param {Collection} a Collection instance. * @param {object} query The query for the count. - * @param {object} [options=null] Optional settings. See Collection.prototype.count for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.count for a list of options. * @param {Collection~countCallback} [callback] The command result callback */ function count(coll, query, options, callback) { @@ -245,7 +245,7 @@ function countDocuments(coll, query, options, callback) { * @method * @param {Collection} a Collection instance. * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. See Collection.prototype.createIndex for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.createIndex for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function createIndex(coll, fieldOrSpec, options, callback) { @@ -313,7 +313,7 @@ function deleteCallback(err, r, callback) { * @method * @param {Collection} a Collection instance. * @param {object} filter The Filter used to select the documents to remove - * @param {object} [options=null] Optional settings. See Collection.prototype.deleteMany for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.deleteMany for a list of options. * @param {Collection~deleteWriteOpCallback} [callback] The command result callback */ function deleteMany(coll, filter, options, callback) { @@ -328,7 +328,7 @@ function deleteMany(coll, filter, options, callback) { * @method * @param {Collection} a Collection instance. * @param {object} filter The Filter used to select the document to remove - * @param {object} [options=null] Optional settings. See Collection.prototype.deleteOne for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.deleteOne for a list of options. * @param {Collection~deleteWriteOpCallback} [callback] The command result callback */ function deleteOne(coll, filter, options, callback) { @@ -343,7 +343,7 @@ function deleteOne(coll, filter, options, callback) { * @param {Collection} a Collection instance. * @param {string} key Field of the document to find distinct values for. * @param {object} query The query for filtering the set of documents to which we apply the distinct filter. - * @param {object} [options=null] Optional settings. See Collection.prototype.distinct for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.distinct for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function distinct(coll, key, query, options, callback) { @@ -383,7 +383,7 @@ function distinct(coll, key, query, options, callback) { * @method * @param {Collection} a Collection instance. * @param {string} indexName Name of the index to drop. - * @param {object} [options=null] Optional settings. See Collection.prototype.dropIndex for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.dropIndex for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function dropIndex(coll, indexName, options, callback) { @@ -422,7 +422,7 @@ function dropIndexes(coll, options, callback) { * @method * @param {Collection} a Collection instance. * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. See Collection.prototype.ensureIndex for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.ensureIndex for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function ensureIndex(coll, fieldOrSpec, options, callback) { @@ -437,7 +437,7 @@ function ensureIndex(coll, fieldOrSpec, options, callback) { * @param {object} query Query object to locate the object to modify. * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate. * @param {object} doc The fields/vals to be updated. - * @param {object} [options=null] Optional settings. See Collection.prototype.findAndModify for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findAndModify for a list of options. * @param {Collection~findAndModifyCallback} [callback] The command result callback * @deprecated use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead */ @@ -512,7 +512,7 @@ function findAndModify(coll, query, sort, doc, options, callback) { * @param {Collection} a Collection instance. * @param {object} query Query object to locate the object to modify. * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate. - * @param {object} [options=null] Optional settings. See Collection.prototype.findAndRemove for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findAndRemove for a list of options. * @param {Collection~resultCallback} [callback] The command result callback * @deprecated use findOneAndDelete instead */ @@ -529,7 +529,7 @@ function findAndRemove(coll, query, sort, options, callback) { * @method * @param {Collection} a Collection instance. * @param {object} query Query for find Operation - * @param {object} [options=null] Optional settings. See Collection.prototype.findOne for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findOne for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function findOne(coll, query, options, callback) { @@ -551,7 +551,7 @@ function findOne(coll, query, options, callback) { * @method * @param {Collection} a Collection instance. * @param {object} filter Document selection filter. - * @param {object} [options=null] Optional settings. See Collection.prototype.findOneAndDelete for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findOneAndDelete for a list of options. * @param {Collection~findAndModifyCallback} [callback] The collection result callback */ function findOneAndDelete(coll, filter, options, callback) { @@ -570,7 +570,7 @@ function findOneAndDelete(coll, filter, options, callback) { * @param {Collection} a Collection instance. * @param {object} filter Document selection filter. * @param {object} replacement Document replacing the matching document. - * @param {object} [options=null] Optional settings. See Collection.prototype.findOneAndReplace for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findOneAndReplace for a list of options. * @param {Collection~findAndModifyCallback} [callback] The collection result callback */ function findOneAndReplace(coll, filter, replacement, options, callback) { @@ -592,7 +592,7 @@ function findOneAndReplace(coll, filter, replacement, options, callback) { * @param {Collection} a Collection instance. * @param {object} filter Document selection filter. * @param {object} update Update operations to be performed on the document - * @param {object} [options=null] Optional settings. See Collection.prototype.findOneAndUpdate for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.findOneAndUpdate for a list of options. * @param {Collection~findAndModifyCallback} [callback] The collection result callback */ function findOneAndUpdate(coll, filter, update, options, callback) { @@ -614,7 +614,7 @@ function findOneAndUpdate(coll, filter, update, options, callback) { * @param {Collection} a Collection instance. * @param {number} x Point to search on the x axis, ensure the indexes are ordered in the same order. * @param {number} y Point to search on the y axis, ensure the indexes are ordered in the same order. - * @param {object} [options=null] Optional settings. See Collection.prototype.geoHaystackSearch for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.geoHaystackSearch for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function geoHaystackSearch(coll, x, y, options, callback) { @@ -655,7 +655,7 @@ function geoHaystackSearch(coll, x, y, options, callback) { * @param {(function|Code)} reduce The reduce function aggregates (reduces) the objects iterated * @param {(function|Code)} finalize An optional function to be run on each item in the result set just before the item is returned. * @param {boolean} command Specify if you wish to run using the internal group command or using eval, default is true. - * @param {object} [options=null] Optional settings. See Collection.prototype.group for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.group for a list of options. * @param {Collection~resultCallback} [callback] The command result callback * @deprecated MongoDB 3.6 or higher will no longer support the group command. We recommend rewriting using the aggregation framework. */ @@ -767,7 +767,7 @@ function indexExists(coll, indexes, options, callback) { * * @method * @param {Collection} a Collection instance. - * @param {object} [options=null] Optional settings. See Collection.prototype.indexInformation for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.indexInformation for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function indexInformation(coll, options, callback) { @@ -814,7 +814,7 @@ function insertDocuments(coll, docs, options, callback) { * @method * @param {Collection} a Collection instance. * @param {object} doc Document to insert. - * @param {object} [options=null] Optional settings. See Collection.prototype.insertOne for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.insertOne for a list of options. * @param {Collection~insertOneWriteOpCallback} [callback] The command result callback */ function insertOne(coll, doc, options, callback) { @@ -858,7 +858,7 @@ function isCapped(coll, options, callback) { * @param {Collection} a Collection instance. * @param {(function|string)} map The mapping function. * @param {(function|string)} reduce The reduce function. - * @param {object} [options=null] Optional settings. See Collection.prototype.mapReduce for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.mapReduce for a list of options. * @param {Collection~resultCallback} [callback] The command result callback */ function mapReduce(coll, map, reduce, options, callback) { @@ -989,7 +989,7 @@ function optionsOp(coll, opts, callback) { * * @method * @param {Collection} a Collection instance. - * @param {object} [options=null] Optional settings. See Collection.prototype.parallelCollectionScan for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.parallelCollectionScan for a list of options. * @param {Collection~parallelCollectionScanCallback} [callback] The command result callback */ function parallelCollectionScan(coll, options, callback) { @@ -1153,7 +1153,7 @@ function removeDocuments(coll, selector, options, callback) { * @method * @param {Collection} a Collection instance. * @param {string} newName New name of of the collection. - * @param {object} [options=null] Optional settings. See Collection.prototype.rename for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.rename for a list of options. * @param {Collection~collectionResultCallback} [callback] The results callback */ function rename(coll, newName, options, callback) { @@ -1200,7 +1200,7 @@ function rename(coll, newName, options, callback) { * @param {Collection} a Collection instance. * @param {object} filter The Filter used to select the document to update * @param {object} doc The Document that replaces the matching document - * @param {object} [options=null] Optional settings. See Collection.prototype.replaceOne for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.replaceOne for a list of options. * @param {Collection~updateWriteOpCallback} [callback] The command result callback */ function replaceOne(coll, filter, doc, options, callback) { @@ -1233,7 +1233,7 @@ function replaceOne(coll, filter, doc, options, callback) { * @method * @param {Collection} a Collection instance. * @param {object} doc Document to save - * @param {object} [options=null] Optional settings. See Collection.prototype.save for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.save for a list of options. * @param {Collection~writeOpCallback} [callback] The command result callback * @deprecated use insertOne, insertMany, updateOne or updateMany */ @@ -1264,7 +1264,7 @@ function save(coll, doc, options, callback) { * * @method * @param {Collection} a Collection instance. - * @param {object} [options=null] Optional settings. See Collection.prototype.stats for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.stats for a list of options. * @param {Collection~resultCallback} [callback] The collection result callback */ function stats(coll, options, callback) { @@ -1360,7 +1360,7 @@ function updateDocuments(coll, selector, document, options, callback) { * @param {Collection} a Collection instance. * @param {object} filter The Filter used to select the documents to update * @param {object} update The update operations to be applied to the document - * @param {object} [options=null] Optional settings. See Collection.prototype.updateMany for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.updateMany for a list of options. * @param {Collection~updateWriteOpCallback} [callback] The command result callback */ function updateMany(coll, filter, update, options, callback) { @@ -1377,7 +1377,7 @@ function updateMany(coll, filter, update, options, callback) { * @param {Collection} a Collection instance. * @param {object} filter The Filter used to select the document to update * @param {object} update The update operations to be applied to the document - * @param {object} [options=null] Optional settings. See Collection.prototype.updateOne for a list of options. + * @param {object} [options] Optional settings. See Collection.prototype.updateOne for a list of options. * @param {Collection~updateWriteOpCallback} [callback] The command result callback */ function updateOne(coll, filter, update, options, callback) { diff --git a/lib/operations/cursor_ops.js b/lib/operations/cursor_ops.js index dfc51f8817..dccc9213e9 100644 --- a/lib/operations/cursor_ops.js +++ b/lib/operations/cursor_ops.js @@ -12,7 +12,7 @@ const push = Array.prototype.push; * @method * @param {Cursor} cursor The Cursor instance on which to count. * @param {boolean} [applySkipLimit=true] Specifies whether the count command apply limit and skip settings should be applied on the cursor or in the provided options. - * @param {object} [options=null] Optional settings. See Cursor.prototype.count for a list of options. + * @param {object} [options] Optional settings. See Cursor.prototype.count for a list of options. * @param {Cursor~countResultCallback} [callback] The result callback. */ function count(cursor, applySkipLimit, opts, callback) { diff --git a/lib/operations/db_ops.js b/lib/operations/db_ops.js index 55ef29d716..de590be0f3 100644 --- a/lib/operations/db_ops.js +++ b/lib/operations/db_ops.js @@ -60,7 +60,7 @@ const illegalCommandFields = [ * @param {Db} db The Db instance on which to add a user. * @param {string} username The username. * @param {string} password The password. - * @param {object} [options=null] Optional settings. See Db.prototype.addUser for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.addUser for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function addUser(db, username, password, options, callback) { @@ -127,7 +127,7 @@ function addUser(db, username, password, options, callback) { * * @method * @param {Db} db The Db instance on which to fetch collections. - * @param {object} [options=null] Optional settings. See Db.prototype.collections for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.collections for a list of options. * @param {Db~collectionsResultCallback} [callback] The results callback */ function collections(db, options, callback) { @@ -167,7 +167,7 @@ function collections(db, options, callback) { * @method * @param {Db} db The Db instance on which to create the collection. * @param {string} name The collection name to create. - * @param {object} [options=null] Optional settings. See Db.prototype.createCollection for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.createCollection for a list of options. * @param {Db~collectionResultCallback} [callback] The results callback */ function createCollection(db, name, options, callback) { @@ -247,7 +247,7 @@ function createCollection(db, name, options, callback) { * @param {Db} db The Db instance on which to create an index. * @param {string} name Name of the collection to create the index on. * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. See Db.prototype.createIndex for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.createIndex for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function createIndex(db, name, fieldOrSpec, options, callback) { @@ -378,7 +378,7 @@ function dropDatabase(db, cmd, options, callback) { * @param {Db} db The Db instance on which to ensure the index. * @param {string} name The index name * @param {(string|object)} fieldOrSpec Defines the index. - * @param {object} [options=null] Optional settings. See Db.prototype.ensureIndex for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.ensureIndex for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function ensureIndex(db, name, fieldOrSpec, options, callback) { @@ -414,7 +414,7 @@ function ensureIndex(db, name, fieldOrSpec, options, callback) { * @param {Db} db The Db instance. * @param {Code} code JavaScript to execute on server. * @param {(object|array)} parameters The parameters for the call. - * @param {object} [options=null] Optional settings. See Db.prototype.eval for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.eval for a list of options. * @param {Db~resultCallback} [callback] The results callback * @deprecated Eval is deprecated on MongoDB 3.2 and forward */ @@ -465,7 +465,7 @@ function evaluate(db, code, parameters, options, callback) { * @method * @param {Db} db The Db instance on which to execute the command. * @param {object} command The command hash - * @param {object} [options=null] Optional settings. See Db.prototype.command for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.command for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function executeCommand(db, command, options, callback) { @@ -502,7 +502,7 @@ function executeCommand(db, command, options, callback) { * @method * @param {Db} db The Db instance on which to execute the command. * @param {object} command The command hash - * @param {object} [options=null] Optional settings. See Db.prototype.executeDbAdminCommand for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.executeDbAdminCommand for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function executeDbAdminCommand(db, selector, options, callback) { @@ -523,7 +523,7 @@ function executeDbAdminCommand(db, selector, options, callback) { * @method * @param {Db} db The Db instance on which to retrieve the index info. * @param {string} name The name of the collection. - * @param {object} [options=null] Optional settings. See Db.prototype.indexInformation for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.indexInformation for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function indexInformation(db, name, options, callback) { @@ -627,7 +627,7 @@ function profilingLevel(db, options, callback) { * @method * @param {Db} db The Db instance on which to remove the user. * @param {string} username The username. - * @param {object} [options=null] Optional settings. See Db.prototype.removeUser for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.removeUser for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function removeUser(db, username, options, callback) { @@ -821,7 +821,7 @@ function createIndexUsingCreateIndexes(db, name, fieldOrSpec, options, callback) * @param {Db} db The Db instance on which to execute the command. * @param {string} username The username of the user to add. * @param {string} password The password of the user to add. - * @param {object} [options=null] Optional settings. See Db.prototype.addUser for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.addUser for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function executeAuthCreateUserCommand(db, username, password, options, callback) { @@ -922,7 +922,7 @@ function executeAuthCreateUserCommand(db, username, password, options, callback) * * @param {Db} db The Db instance on which to execute the command. * @param {string} username The username of the user to remove. - * @param {object} [options=null] Optional settings. See Db.prototype.removeUser for a list of options. + * @param {object} [options] Optional settings. See Db.prototype.removeUser for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function executeAuthRemoveUserCommand(db, username, options, callback) { diff --git a/lib/operations/mongo_client_ops.js b/lib/operations/mongo_client_ops.js index 361f4fa407..a3f6500dc6 100644 --- a/lib/operations/mongo_client_ops.js +++ b/lib/operations/mongo_client_ops.js @@ -450,7 +450,7 @@ function legacyTransformUrlOptions(object) { * * @method * @param {MongoClient} mongoClient The MongoClient instance on which to logout. - * @param {object} [options=null] Optional settings. See MongoClient.prototype.logout for a list of options. + * @param {object} [options] Optional settings. See MongoClient.prototype.logout for a list of options. * @param {Db~resultCallback} [callback] The command result callback */ function logout(mongoClient, dbName, callback) { diff --git a/lib/topologies/mongos.js b/lib/topologies/mongos.js index 39dff165e5..dc14277370 100644 --- a/lib/topologies/mongos.js +++ b/lib/topologies/mongos.js @@ -63,7 +63,7 @@ var legalOptionNames = [ * @class * @deprecated * @param {Server[]} servers A seedlist of servers participating in the replicaset. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {booelan} [options.ha=true] Turn on high availability monitoring. * @param {number} [options.haInterval=5000] Time between each replicaset status check. * @param {number} [options.poolSize=5] Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. @@ -71,15 +71,15 @@ var legalOptionNames = [ * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support) * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. * @param {boolean} [options.sslValidate=true] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {string} [options.servername=null] String containing the server name requested via TLS SNI. - * @param {object} [options.socketOptions=null] Socket options + * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {string} [options.servername] String containing the server name requested via TLS SNI. + * @param {object} [options.socketOptions] Socket options * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option. * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled * @param {number} [options.socketOptions.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket diff --git a/lib/topologies/replset.js b/lib/topologies/replset.js index 4bccb79dce..0a73134437 100644 --- a/lib/topologies/replset.js +++ b/lib/topologies/replset.js @@ -71,7 +71,7 @@ var legalOptionNames = [ * @class * @deprecated * @param {Server[]} servers A seedlist of servers participating in the replicaset. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {boolean} [options.ha=true] Turn on high availability monitoring. * @param {number} [options.haInterval=10000] Time between each replicaset status check. * @param {string} [options.replicaSet] The name of the replicaset to connect to. @@ -81,15 +81,15 @@ var legalOptionNames = [ * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support) * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. * @param {boolean} [options.sslValidate=true] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher. - * @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {string} [options.servername=null] String containing the server name requested via TLS SNI. - * @param {object} [options.socketOptions=null] Socket options + * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher. + * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {string} [options.servername] String containing the server name requested via TLS SNI. + * @param {object} [options.socketOptions] Socket options * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option. * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled * @param {number} [options.socketOptions.keepAliveInitialDelay=30000] The number of milliseconds to wait before initiating keepAlive on the TCP socket diff --git a/lib/topologies/server.js b/lib/topologies/server.js index 904d13eac5..103496a1e5 100644 --- a/lib/topologies/server.js +++ b/lib/topologies/server.js @@ -67,20 +67,20 @@ var legalOptionNames = [ * @deprecated * @param {string} host The host for the server, can be either an IP4, IP6 or domain socket style host. * @param {number} [port] The server port if IP4. - * @param {object} [options=null] Optional settings. + * @param {object} [options] Optional settings. * @param {number} [options.poolSize=5] Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons. * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support) * @param {boolean} [options.sslValidate=true] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher) * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. - * @param {array} [options.sslCA=null] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {array} [options.sslCRL=null] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslCert=null] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {string} [options.ciphers=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {string} [options.ecdhCurve=null] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. - * @param {(Buffer|string)} [options.sslKey=null] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {(Buffer|string)} [options.sslPass=null] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) - * @param {string} [options.servername=null] String containing the server name requested via TLS SNI. - * @param {object} [options.socketOptions=null] Socket options + * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info. + * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher) + * @param {string} [options.servername] String containing the server name requested via TLS SNI. + * @param {object} [options.socketOptions] Socket options * @param {boolean} [options.socketOptions.autoReconnect=true] Reconnect on error. * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option. * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled