Skip to content

Commit ebf798d

Browse files
committed
fixed all api docs to correctly include the return Promise
1 parent c25b96d commit ebf798d

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
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 {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
5959
* @param {number} [options.maxTimeMS=null] Number of milliseconds to wait before aborting the query.
6060
* @param {Admin~resultCallback} callback The command result callback
61-
* @return {null}
61+
* @return {Promise} returns Promise if no callback passed
6262
*/
6363
Admin.prototype.command = function(command, options, callback) {
6464
var self = this;
@@ -87,7 +87,7 @@ Admin.prototype.command = function(command, options, callback) {
8787
* instance of the db client
8888
*
8989
* @param {Admin~resultCallback} callback The command result callback
90-
* @return {null}
90+
* @return {Promise} returns Promise if no callback passed
9191
*/
9292
Admin.prototype.buildInfo = function(callback) {
9393
var self = this;
@@ -108,7 +108,7 @@ Admin.prototype.buildInfo = function(callback) {
108108
* instance of the db client
109109
*
110110
* @param {Admin~resultCallback} callback The command result callback
111-
* @return {null}
111+
* @return {Promise} returns Promise if no callback passed
112112
*/
113113
Admin.prototype.serverInfo = function(callback) {
114114
var self = this;
@@ -131,7 +131,7 @@ Admin.prototype.serverInfo = function(callback) {
131131
* Retrieve this db's server status.
132132
*
133133
* @param {Admin~resultCallback} callback The command result callback
134-
* @return {null}
134+
* @return {Promise} returns Promise if no callback passed
135135
*/
136136
Admin.prototype.serverStatus = function(callback) {
137137
var self = this;
@@ -163,7 +163,7 @@ var serverStatus = function(self, callback) {
163163
* Retrieve the current profiling Level for MongoDB
164164
*
165165
* @param {Admin~resultCallback} callback The command result callback
166-
* @return {null}
166+
* @return {Promise} returns Promise if no callback passed
167167
*/
168168
Admin.prototype.profilingLevel = function(callback) {
169169
var self = this;
@@ -200,7 +200,7 @@ var profilingLevel = function(self, callback) {
200200
* Ping the MongoDB server and retrieve results
201201
*
202202
* @param {Admin~resultCallback} callback The command result callback
203-
* @return {null}
203+
* @return {Promise} returns Promise if no callback passed
204204
*/
205205
Admin.prototype.ping = function(options, callback) {
206206
var self = this;
@@ -226,7 +226,7 @@ Admin.prototype.ping = function(options, callback) {
226226
* @param {string} username The username.
227227
* @param {string} [password] The password.
228228
* @param {Admin~resultCallback} callback The command result callback
229-
* @return {null}
229+
* @return {Promise} returns Promise if no callback passed
230230
*/
231231
Admin.prototype.authenticate = function(username, password, callback) {
232232
var self = this;
@@ -246,7 +246,7 @@ Admin.prototype.authenticate = function(username, password, callback) {
246246
* Logout user from server, fire off on all connections and remove all auth info
247247
* @method
248248
* @param {Admin~resultCallback} callback The command result callback
249-
* @return {null}
249+
* @return {Promise} returns Promise if no callback passed
250250
*/
251251
Admin.prototype.logout = function(callback) {
252252
var self = this;
@@ -275,7 +275,7 @@ Admin.prototype.logout = function(callback) {
275275
* @param {object} [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher)
276276
* @param {object[]} [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher)
277277
* @param {Admin~resultCallback} callback The command result callback
278-
* @return {null}
278+
* @return {Promise} returns Promise if no callback passed
279279
*/
280280
Admin.prototype.addUser = function(username, password, options, callback) {
281281
var self = this;
@@ -309,7 +309,7 @@ Admin.prototype.addUser = function(username, password, options, callback) {
309309
* @param {boolean} [options.j=false] Specify a journal write concern.
310310
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
311311
* @param {Admin~resultCallback} callback The command result callback
312-
* @return {null}
312+
* @return {Promise} returns Promise if no callback passed
313313
*/
314314
Admin.prototype.removeUser = function(username, options, callback) {
315315
var self = this;
@@ -337,7 +337,7 @@ Admin.prototype.removeUser = function(username, options, callback) {
337337
*
338338
* @param {string} level The new profiling level (off, slow_only, all).
339339
* @param {Admin~resultCallback} callback The command result callback.
340-
* @return {null}
340+
* @return {Promise} returns Promise if no callback passed
341341
*/
342342
Admin.prototype.setProfilingLevel = function(level, callback) {
343343
var self = this;
@@ -384,7 +384,7 @@ var setProfilingLevel = function(self, level, callback) {
384384
* Retrive the current profiling information for MongoDB
385385
*
386386
* @param {Admin~resultCallback} callback The command result callback.
387-
* @return {null}
387+
* @return {Promise} returns Promise if no callback passed
388388
*/
389389
Admin.prototype.profilingInfo = function(callback) {
390390
var self = this;
@@ -415,7 +415,7 @@ var profilingInfo = function(self, callback) {
415415
* @param {string} collectionName The name of the collection to validate.
416416
* @param {object} [options=null] Optional settings.
417417
* @param {Admin~resultCallback} callback The command result callback.
418-
* @return {null}
418+
* @return {Promise} returns Promise if no callback passed
419419
*/
420420
Admin.prototype.validateCollection = function(collectionName, options, callback) {
421421
var self = this;
@@ -468,7 +468,7 @@ var validateCollection = function(self, collectionName, options, callback) {
468468
* List the available databases
469469
*
470470
* @param {Admin~resultCallback} callback The command result callback.
471-
* @return {null}
471+
* @return {Promise} returns Promise if no callback passed
472472
*/
473473
Admin.prototype.listDatabases = function(callback) {
474474
var self = this;
@@ -488,7 +488,7 @@ Admin.prototype.listDatabases = function(callback) {
488488
* Get ReplicaSet status
489489
*
490490
* @param {Admin~resultCallback} callback The command result callback.
491-
* @return {null}
491+
* @return {Promise} returns Promise if no callback passed
492492
*/
493493
Admin.prototype.replSetGetStatus = function(callback) {
494494
var self = this;

lib/aggregation_cursor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
292292
* @function AggregationCursor.prototype.next
293293
* @param {AggregationCursor~resultCallback} callback The result callback.
294294
* @throws {MongoError}
295-
* @return {null}
295+
* @return {Promise} returns Promise if no callback passed
296296
*/
297297

298298
/**
@@ -324,7 +324,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
324324
* @method AggregationCursor.prototype.toArray
325325
* @param {AggregationCursor~toArrayResultCallback} callback The result callback.
326326
* @throws {MongoError}
327-
* @return {null}
327+
* @return {Promise} returns Promise if no callback passed
328328
*/
329329

330330
/**
@@ -351,7 +351,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
351351
* Close the cursor, sending a AggregationCursor command and emitting close.
352352
* @method AggregationCursor.prototype.close
353353
* @param {AggregationCursor~resultCallback} [callback] The result callback.
354-
* @return {null}
354+
* @return {Promise} returns Promise if no callback passed
355355
*/
356356

357357
/**
@@ -364,7 +364,7 @@ AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
364364
* Execute the explain for the cursor
365365
* @method AggregationCursor.prototype.explain
366366
* @param {AggregationCursor~resultCallback} [callback] The result callback.
367-
* @return {null}
367+
* @return {Promise} returns Promise if no callback passed
368368
*/
369369

370370
/**

lib/bulk/ordered.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ var executeCommands = function(self, callback) {
448448
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
449449
* @param {OrderedBulkOperation~resultCallback} callback The result callback
450450
* @throws {MongoError}
451-
* @return {null}
451+
* @return {Promise} returns Promise if no callback passed
452452
*/
453453
OrderedBulkOperation.prototype.execute = function(_writeConcern, callback) {
454454
var self = this;

lib/bulk/unordered.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ var executeBatches = function(self, callback) {
456456
* @param {boolean} [options.fsync=false] Specify a file sync write concern.
457457
* @param {UnorderedBulkOperation~resultCallback} callback The result callback
458458
* @throws {MongoError}
459-
* @return {null}
459+
* @return {Promise} returns Promise if no callback passed
460460
*/
461461
UnorderedBulkOperation.prototype.execute = function(_writeConcern, callback) {
462462
var self = this;

lib/command_cursor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ CommandCursor.prototype.get = CommandCursor.prototype.toArray;
186186
* @function CommandCursor.prototype.next
187187
* @param {CommandCursor~resultCallback} callback The result callback.
188188
* @throws {MongoError}
189-
* @return {null}
189+
* @return {Promise} returns Promise if no callback passed
190190
*/
191191

192192
/**
@@ -217,7 +217,7 @@ CommandCursor.prototype.get = CommandCursor.prototype.toArray;
217217
* @method CommandCursor.prototype.toArray
218218
* @param {CommandCursor~toArrayResultCallback} callback The result callback.
219219
* @throws {MongoError}
220-
* @return {null}
220+
* @return {Promise} returns Promise if no callback passed
221221
*/
222222

223223
/**
@@ -244,7 +244,7 @@ CommandCursor.prototype.get = CommandCursor.prototype.toArray;
244244
* Close the cursor, sending a KillCursor command and emitting close.
245245
* @method CommandCursor.prototype.close
246246
* @param {CommandCursor~resultCallback} [callback] The result callback.
247-
* @return {null}
247+
* @return {Promise} returns Promise if no callback passed
248248
*/
249249

250250
/**

lib/cursor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Cursor.prototype.skip = function(value) {
368368
* @function external:CoreCursor#next
369369
* @param {Cursor~resultCallback} callback The result callback.
370370
* @throws {MongoError}
371-
* @return {null}
371+
* @return {Promise} returns Promise if no callback passed
372372
*/
373373

374374
/**

lib/db.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ var addUser = function(self, username, password, options, callback) {
11211121
* @param {object} [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher)
11221122
* @param {object[]} [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher)
11231123
* @param {Db~resultCallback} callback The command result callback
1124-
* @return {null}
1124+
* @return {Promise} returns Promise if no callback passed
11251125
*/
11261126
Db.prototype.addUser = function(username, password, options, callback) {
11271127
// Unpack the parameters
@@ -1210,7 +1210,7 @@ var removeUser = function(self, username, options, callback) {
12101210
* @param {number} [options.wtimeout=null] The write concern timeout.
12111211
* @param {boolean} [options.j=false] Specify a journal write concern.
12121212
* @param {Db~resultCallback} callback The command result callback
1213-
* @return {null}
1213+
* @return {Promise} returns Promise if no callback passed
12141214
*/
12151215
Db.prototype.removeUser = function(username, options, callback) {
12161216
// Unpack the parameters
@@ -1304,7 +1304,7 @@ var authenticate = function(self, username, password, options, callback) {
13041304
* @param {object} [options=null] Optional settings.
13051305
* @param {string} [options.authMechanism=MONGODB-CR] The authentication mechanism to use, GSSAPI, MONGODB-CR, MONGODB-X509, PLAIN
13061306
* @param {Db~resultCallback} callback The command result callback
1307-
* @return {null}
1307+
* @return {Promise} returns Promise if no callback passed
13081308
*/
13091309
Db.prototype.authenticate = function(username, password, options, callback) {
13101310
if(typeof options == 'function') callback = options, options = {};
@@ -1341,7 +1341,7 @@ Db.prototype.authenticate = function(username, password, options, callback) {
13411341
* @param {object} [options=null] Optional settings.
13421342
* @param {string} [options.dbName=null] Logout against different database than current.
13431343
* @param {Db~resultCallback} callback The command result callback
1344-
* @return {null}
1344+
* @return {Promise} returns Promise if no callback passed
13451345
*/
13461346
Db.prototype.logout = function(options, callback) {
13471347
var self = this;
@@ -1389,7 +1389,7 @@ var getReadPreference = function(options, db) {
13891389
* @param {boolean} [options.full=false] Returns the full raw index information.
13901390
* @param {(ReadPreference|string)} [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
13911391
* @param {Db~resultCallback} callback The command result callback
1392-
* @return {null}
1392+
* @return {Promise} returns Promise if no callback passed
13931393
*/
13941394
Db.prototype.indexInformation = function(name, options, callback) {
13951395
var self = this;

0 commit comments

Comments
 (0)