Mongoose - Get replica set primary

393 Views Asked by At

I am building a node server using mongoose.

I have a few mongodb instances running as a replica set and I am connected to that set using mongoose.

I would like to get the RS primary server in my node server. if I could run the mongo command rs.isMaster that would be helpful.

Is there a way to do it?

0

There are 0 best solutions below