Skip to content

Commit 1d80c5e

Browse files
committed
updated jsDOC comments where callbacks are optional
1 parent 70ceff3 commit 1d80c5e

File tree

10 files changed

+102
-102
lines changed

10 files changed

+102
-102
lines changed

lib/admin.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var Admin = function(db, topology, promiseLibrary) {
5858
* @param {object} [options=null] Optional settings.
5959
* @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
6060
* @param {number} [options.maxTimeMS=null] Number of milliseconds to wait before aborting the query.
61-
* @param {Admin~resultCallback} callback The command result callback
61+
* @param {Admin~resultCallback} [callback] The command result callback
6262
* @return {Promise} returns Promise if no callback passed
6363
*/
6464
Admin.prototype.command = function(command, options, callback) {
@@ -87,7 +87,7 @@ Admin.prototype.command = function(command, options, callback) {
8787
* Retrieve the server information for the current
8888
* instance of the db client
8989
*
90-
* @param {Admin~resultCallback} callback The command result callback
90+
* @param {Admin~resultCallback} [callback] The command result callback
9191
* @return {Promise} returns Promise if no callback passed
9292
*/
9393
Admin.prototype.buildInfo = function(callback) {
@@ -108,7 +108,7 @@ Admin.prototype.buildInfo = function(callback) {
108108
* Retrieve the server information for the current
109109
* instance of the db client
110110
*
111-
* @param {Admin~resultCallback} callback The command result callback
111+
* @param {Admin~resultCallback} [callback] The command result callback
112112
* @return {Promise} returns Promise if no callback passed
113113
*/
114114
Admin.prototype.serverInfo = function(callback) {
@@ -131,7 +131,7 @@ Admin.prototype.serverInfo = function(callback) {
131131
/**
132132
* Retrieve this db's server status.
133133
*
134-
* @param {Admin~resultCallback} callback The command result callback
134+
* @param {Admin~resultCallback} [callback] The command result callback
135135
* @return {Promise} returns Promise if no callback passed
136136
*/
137137
Admin.prototype.serverStatus = function(callback) {
@@ -163,7 +163,7 @@ var serverStatus = function(self, callback) {
163163
/**
164164
* Retrieve the current profiling Level for MongoDB
165165
*
166-
* @param {Admin~resultCallback} callback The command result callback
166+
* @param {Admin~resultCallback} [callback] The command result callback
167167
* @return {Promise} returns Promise if no callback passed
168168
*/
169169
Admin.prototype.profilingLevel = function(callback) {
@@ -200,7 +200,7 @@ var profilingLevel = function(self, callback) {
200200
/**
201201
* Ping the MongoDB server and retrieve results
202202
*
203-
* @param {Admin~resultCallback} callback The command result callback
203+
* @param {Admin~resultCallback} [callback] The command result callback
204204
* @return {Promise} returns Promise if no callback passed
205205
*/
206206
Admin.prototype.ping = function(options, callback) {
@@ -226,7 +226,7 @@ Admin.prototype.ping = function(options, callback) {
226226
* @method
227227
* @param {string} username The username.
228228
* @param {string} [password] The password.
229-
* @param {Admin~resultCallback} callback The command result callback
229+
* @param {Admin~resultCallback} [callback] The command result callback
230230
* @return {Promise} returns Promise if no callback passed
231231
*/
232232
Admin.prototype.authenticate = function(username, password, callback) {
@@ -246,7 +246,7 @@ Admin.prototype.authenticate = function(username, password, callback) {
246246
/**
247247
* Logout user from server, fire off on all connections and remove all auth info
248248
* @method
249-
* @param {Admin~resultCallback} callback The command result callback
249+
* @param {Admin~resultCallback} [callback] The command result callback
250250
* @return {Promise} returns Promise if no callback passed
251251
*/
252252
Admin.prototype.logout = function(callback) {
@@ -296,7 +296,7 @@ var writeConcern = function(options, db) {
296296
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
297297
* @param {object} [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher)
298298
* @param {object[]} [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher)
299-
* @param {Admin~resultCallback} callback The command result callback
299+
* @param {Admin~resultCallback} [callback] The command result callback
300300
* @return {Promise} returns Promise if no callback passed
301301
*/
302302
Admin.prototype.addUser = function(username, password, options, callback) {
@@ -333,7 +333,7 @@ Admin.prototype.addUser = function(username, password, options, callback) {
333333
* @param {number} [options.wtimeout=null] The write concern timeout.
334334
* @param {boolean} [options.j=false] Specify a journal write concern.
335335
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
336-
* @param {Admin~resultCallback} callback The command result callback
336+
* @param {Admin~resultCallback} [callback] The command result callback
337337
* @return {Promise} returns Promise if no callback passed
338338
*/
339339
Admin.prototype.removeUser = function(username, options, callback) {
@@ -365,7 +365,7 @@ Admin.prototype.removeUser = function(username, options, callback) {
365365
* Set the current profiling level of MongoDB
366366
*
367367
* @param {string} level The new profiling level (off, slow_only, all).
368-
* @param {Admin~resultCallback} callback The command result callback.
368+
* @param {Admin~resultCallback} [callback] The command result callback.
369369
* @return {Promise} returns Promise if no callback passed
370370
*/
371371
Admin.prototype.setProfilingLevel = function(level, callback) {
@@ -412,7 +412,7 @@ var setProfilingLevel = function(self, level, callback) {
412412
/**
413413
* Retrive the current profiling information for MongoDB
414414
*
415-
* @param {Admin~resultCallback} callback The command result callback.
415+
* @param {Admin~resultCallback} [callback] The command result callback.
416416
* @return {Promise} returns Promise if no callback passed
417417
*/
418418
Admin.prototype.profilingInfo = function(callback) {
@@ -443,7 +443,7 @@ var profilingInfo = function(self, callback) {
443443
*
444444
* @param {string} collectionName The name of the collection to validate.
445445
* @param {object} [options=null] Optional settings.
446-
* @param {Admin~resultCallback} callback The command result callback.
446+
* @param {Admin~resultCallback} [callback] The command result callback.
447447
* @return {Promise} returns Promise if no callback passed
448448
*/
449449
Admin.prototype.validateCollection = function(collectionName, options, callback) {
@@ -497,7 +497,7 @@ var validateCollection = function(self, collectionName, options, callback) {
497497
/**
498498
* List the available databases
499499
*
500-
* @param {Admin~resultCallback} callback The command result callback.
500+
* @param {Admin~resultCallback} [callback] The command result callback.
501501
* @return {Promise} returns Promise if no callback passed
502502
*/
503503
Admin.prototype.listDatabases = function(callback) {
@@ -517,7 +517,7 @@ Admin.prototype.listDatabases = function(callback) {
517517
/**
518518
* Get ReplicaSet status
519519
*
520-
* @param {Admin~resultCallback} callback The command result callback.
520+
* @param {Admin~resultCallback} [callback] The command result callback.
521521
* @return {Promise} returns Promise if no callback passed
522522
*/
523523
Admin.prototype.replSetGetStatus = function(callback) {

lib/aggregation_cursor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
287287
/**
288288
* Get the next available document from the cursor, returns null if no more documents are available.
289289
* @function AggregationCursor.prototype.next
290-
* @param {AggregationCursor~resultCallback} callback The result callback.
290+
* @param {AggregationCursor~resultCallback} [callback] The result callback.
291291
* @throws {MongoError}
292292
* @return {Promise} returns Promise if no callback passed
293293
*/
@@ -319,7 +319,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
319319
* results when this cursor had been previouly accessed. In that case,
320320
* cursor.rewind() can be used to reset the cursor.
321321
* @method AggregationCursor.prototype.toArray
322-
* @param {AggregationCursor~toArrayResultCallback} callback The result callback.
322+
* @param {AggregationCursor~toArrayResultCallback} [callback] The result callback.
323323
* @throws {MongoError}
324324
* @return {Promise} returns Promise if no callback passed
325325
*/

lib/bulk/ordered.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ var executeCommands = function(self, callback) {
446446
* @param {number} [options.wtimeout=null] The write concern timeout.
447447
* @param {boolean} [options.j=false] Specify a journal write concern.
448448
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
449-
* @param {OrderedBulkOperation~resultCallback} callback The result callback
449+
* @param {OrderedBulkOperation~resultCallback} [callback] The result callback
450450
* @throws {MongoError}
451451
* @return {Promise} returns Promise if no callback passed
452452
*/

lib/bulk/unordered.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ var executeBatches = function(self, callback) {
454454
* @param {number} [options.wtimeout=null] The write concern timeout.
455455
* @param {boolean} [options.j=false] Specify a journal write concern.
456456
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
457-
* @param {UnorderedBulkOperation~resultCallback} callback The result callback
457+
* @param {UnorderedBulkOperation~resultCallback} [callback] The result callback
458458
* @throws {MongoError}
459459
* @return {Promise} returns Promise if no callback passed
460460
*/

0 commit comments

Comments
 (0)