@@ -58,7 +58,7 @@ var Admin = function(db, topology, promiseLibrary) {
58
58
* @param {(ReadPreference|string) } [options.readPreference=null] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
59
59
* @param {number } [options.maxTimeMS=null] Number of milliseconds to wait before aborting the query.
60
60
* @param {Admin~resultCallback } callback The command result callback
61
- * @return {null }
61
+ * @return {Promise } returns Promise if no callback passed
62
62
*/
63
63
Admin . prototype . command = function ( command , options , callback ) {
64
64
var self = this ;
@@ -87,7 +87,7 @@ Admin.prototype.command = function(command, options, callback) {
87
87
* instance of the db client
88
88
*
89
89
* @param {Admin~resultCallback } callback The command result callback
90
- * @return {null }
90
+ * @return {Promise } returns Promise if no callback passed
91
91
*/
92
92
Admin . prototype . buildInfo = function ( callback ) {
93
93
var self = this ;
@@ -108,7 +108,7 @@ Admin.prototype.buildInfo = function(callback) {
108
108
* instance of the db client
109
109
*
110
110
* @param {Admin~resultCallback } callback The command result callback
111
- * @return {null }
111
+ * @return {Promise } returns Promise if no callback passed
112
112
*/
113
113
Admin . prototype . serverInfo = function ( callback ) {
114
114
var self = this ;
@@ -131,7 +131,7 @@ Admin.prototype.serverInfo = function(callback) {
131
131
* Retrieve this db's server status.
132
132
*
133
133
* @param {Admin~resultCallback } callback The command result callback
134
- * @return {null }
134
+ * @return {Promise } returns Promise if no callback passed
135
135
*/
136
136
Admin . prototype . serverStatus = function ( callback ) {
137
137
var self = this ;
@@ -163,7 +163,7 @@ var serverStatus = function(self, callback) {
163
163
* Retrieve the current profiling Level for MongoDB
164
164
*
165
165
* @param {Admin~resultCallback } callback The command result callback
166
- * @return {null }
166
+ * @return {Promise } returns Promise if no callback passed
167
167
*/
168
168
Admin . prototype . profilingLevel = function ( callback ) {
169
169
var self = this ;
@@ -200,7 +200,7 @@ var profilingLevel = function(self, callback) {
200
200
* Ping the MongoDB server and retrieve results
201
201
*
202
202
* @param {Admin~resultCallback } callback The command result callback
203
- * @return {null }
203
+ * @return {Promise } returns Promise if no callback passed
204
204
*/
205
205
Admin . prototype . ping = function ( options , callback ) {
206
206
var self = this ;
@@ -226,7 +226,7 @@ Admin.prototype.ping = function(options, callback) {
226
226
* @param {string } username The username.
227
227
* @param {string } [password] The password.
228
228
* @param {Admin~resultCallback } callback The command result callback
229
- * @return {null }
229
+ * @return {Promise } returns Promise if no callback passed
230
230
*/
231
231
Admin . prototype . authenticate = function ( username , password , callback ) {
232
232
var self = this ;
@@ -246,7 +246,7 @@ Admin.prototype.authenticate = function(username, password, callback) {
246
246
* Logout user from server, fire off on all connections and remove all auth info
247
247
* @method
248
248
* @param {Admin~resultCallback } callback The command result callback
249
- * @return {null }
249
+ * @return {Promise } returns Promise if no callback passed
250
250
*/
251
251
Admin . prototype . logout = function ( callback ) {
252
252
var self = this ;
@@ -275,7 +275,7 @@ Admin.prototype.logout = function(callback) {
275
275
* @param {object } [options.customData=null] Custom data associated with the user (only Mongodb 2.6 or higher)
276
276
* @param {object[] } [options.roles=null] Roles associated with the created user (only Mongodb 2.6 or higher)
277
277
* @param {Admin~resultCallback } callback The command result callback
278
- * @return {null }
278
+ * @return {Promise } returns Promise if no callback passed
279
279
*/
280
280
Admin . prototype . addUser = function ( username , password , options , callback ) {
281
281
var self = this ;
@@ -309,7 +309,7 @@ Admin.prototype.addUser = function(username, password, options, callback) {
309
309
* @param {boolean } [options.j=false] Specify a journal write concern.
310
310
* @param {boolean } [options.fsync=false] Specify a file sync write concern.
311
311
* @param {Admin~resultCallback } callback The command result callback
312
- * @return {null }
312
+ * @return {Promise } returns Promise if no callback passed
313
313
*/
314
314
Admin . prototype . removeUser = function ( username , options , callback ) {
315
315
var self = this ;
@@ -337,7 +337,7 @@ Admin.prototype.removeUser = function(username, options, callback) {
337
337
*
338
338
* @param {string } level The new profiling level (off, slow_only, all).
339
339
* @param {Admin~resultCallback } callback The command result callback.
340
- * @return {null }
340
+ * @return {Promise } returns Promise if no callback passed
341
341
*/
342
342
Admin . prototype . setProfilingLevel = function ( level , callback ) {
343
343
var self = this ;
@@ -384,7 +384,7 @@ var setProfilingLevel = function(self, level, callback) {
384
384
* Retrive the current profiling information for MongoDB
385
385
*
386
386
* @param {Admin~resultCallback } callback The command result callback.
387
- * @return {null }
387
+ * @return {Promise } returns Promise if no callback passed
388
388
*/
389
389
Admin . prototype . profilingInfo = function ( callback ) {
390
390
var self = this ;
@@ -415,7 +415,7 @@ var profilingInfo = function(self, callback) {
415
415
* @param {string } collectionName The name of the collection to validate.
416
416
* @param {object } [options=null] Optional settings.
417
417
* @param {Admin~resultCallback } callback The command result callback.
418
- * @return {null }
418
+ * @return {Promise } returns Promise if no callback passed
419
419
*/
420
420
Admin . prototype . validateCollection = function ( collectionName , options , callback ) {
421
421
var self = this ;
@@ -468,7 +468,7 @@ var validateCollection = function(self, collectionName, options, callback) {
468
468
* List the available databases
469
469
*
470
470
* @param {Admin~resultCallback } callback The command result callback.
471
- * @return {null }
471
+ * @return {Promise } returns Promise if no callback passed
472
472
*/
473
473
Admin . prototype . listDatabases = function ( callback ) {
474
474
var self = this ;
@@ -488,7 +488,7 @@ Admin.prototype.listDatabases = function(callback) {
488
488
* Get ReplicaSet status
489
489
*
490
490
* @param {Admin~resultCallback } callback The command result callback.
491
- * @return {null }
491
+ * @return {Promise } returns Promise if no callback passed
492
492
*/
493
493
Admin . prototype . replSetGetStatus = function ( callback ) {
494
494
var self = this ;
0 commit comments