How to get slave status of mongodb using nodejs?

后端 未结 1 473

I want to get slavestatus of mongodb server using node js. Here is the code.

var Db = require(\'mongodb\').Db, Server = require(\'mongodb\').Server;
                


        
1条回答
  •  悲哀的现实
    2021-01-14 06:40

    That would be "replSetGetStatus"

    admiDb.command({ "replSetGetStatus": 1 }, function(err,result) {
    
    })
    

    As noted there is a full list of Database Commands in the core documentation. These are the "building blocks" of the BSON structure of what is sent to the server to initiate operations.

    Just about everything in all driver implementations uses this command list. And all drivers provide a variant of .command() in order to issue them.

    0 讨论(0)
提交回复
热议问题