@@ -69,7 +69,7 @@ Admin.prototype.command = function(command, options, callback) {
69
69
callback = typeof args [ args . length - 1 ] === 'function' ? args . pop ( ) : undefined ;
70
70
options = args . length ? args . shift ( ) : { } ;
71
71
72
- return executeOperation ( this . s . db , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
72
+ return executeOperation ( this . s . db . s . topology , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
73
73
command ,
74
74
options ,
75
75
callback
@@ -91,7 +91,7 @@ Admin.prototype.buildInfo = function(options, callback) {
91
91
if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
92
92
93
93
const cmd = { buildinfo : 1 } ;
94
- return executeOperation ( this . s . db , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
94
+ return executeOperation ( this . s . db . s . topology , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
95
95
cmd ,
96
96
undefined ,
97
97
callback
@@ -113,7 +113,7 @@ Admin.prototype.serverInfo = function(options, callback) {
113
113
if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
114
114
115
115
const cmd = { buildinfo : 1 } ;
116
- return executeOperation ( this . s . db , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
116
+ return executeOperation ( this . s . db . s . topology , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
117
117
cmd ,
118
118
options ,
119
119
callback
@@ -132,7 +132,7 @@ define.classMethod('serverInfo', { callback: true, promise: true });
132
132
*/
133
133
Admin . prototype . serverStatus = function ( options , callback ) {
134
134
if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
135
- return executeOperation ( this . s . db , serverStatus , [ this , options , callback ] ) ;
135
+ return executeOperation ( this . s . db . s . topology , serverStatus , [ this , options , callback ] ) ;
136
136
} ;
137
137
138
138
var serverStatus = function ( self , options , callback ) {
@@ -160,7 +160,7 @@ Admin.prototype.ping = function(options, callback) {
160
160
if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
161
161
162
162
const cmd = { ping : 1 } ;
163
- return executeOperation ( this . s . db , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
163
+ return executeOperation ( this . s . db . s . topology , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
164
164
cmd ,
165
165
options ,
166
166
callback
@@ -218,7 +218,7 @@ Admin.prototype.addUser = function(username, password, options, callback) {
218
218
// Set the db name to admin
219
219
options . dbName = 'admin' ;
220
220
221
- return executeOperation ( this . s . db , this . s . db . addUser . bind ( this . s . db ) , [
221
+ return executeOperation ( this . s . db . s . topology , this . s . db . addUser . bind ( this . s . db ) , [
222
222
username ,
223
223
password ,
224
224
options ,
@@ -253,7 +253,7 @@ Admin.prototype.removeUser = function(username, options, callback) {
253
253
// Set the db name
254
254
options . dbName = 'admin' ;
255
255
256
- return executeOperation ( this . s . db , this . s . db . removeUser . bind ( this . s . db ) , [
256
+ return executeOperation ( this . s . db . s . topology , this . s . db . removeUser . bind ( this . s . db ) , [
257
257
username ,
258
258
options ,
259
259
callback
@@ -278,7 +278,7 @@ Admin.prototype.validateCollection = function(collectionName, options, callback)
278
278
options = args . length ? args . shift ( ) : { } ;
279
279
options = options || { } ;
280
280
281
- return executeOperation ( this . s . db , validateCollection , [ this , collectionName , options , callback ] ) ;
281
+ return executeOperation ( this . s . db . s . topology , validateCollection , [ this , collectionName , options , callback ] ) ;
282
282
} ;
283
283
284
284
var validateCollection = function ( self , collectionName , options , callback ) {
@@ -324,7 +324,7 @@ Admin.prototype.listDatabases = function(options, callback) {
324
324
325
325
var cmd = { listDatabases : 1 } ;
326
326
if ( options . nameOnly ) cmd . nameOnly = Number ( cmd . nameOnly ) ;
327
- return executeOperation ( this . s . db , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
327
+ return executeOperation ( this . s . db . s . topology , this . s . db . executeDbAdminCommand . bind ( this . s . db ) , [
328
328
cmd ,
329
329
options ,
330
330
callback
@@ -343,7 +343,7 @@ define.classMethod('listDatabases', { callback: true, promise: true });
343
343
*/
344
344
Admin . prototype . replSetGetStatus = function ( options , callback ) {
345
345
if ( typeof options === 'function' ) ( callback = options ) , ( options = { } ) ;
346
- return executeOperation ( this . s . db , replSetGetStatus , [ this , options , callback ] ) ;
346
+ return executeOperation ( this . s . db . s . topology , replSetGetStatus , [ this , options , callback ] ) ;
347
347
} ;
348
348
349
349
var replSetGetStatus = function ( self , options , callback ) {
0 commit comments