I am trying to detect if a server in a replica set is a master or slave node using the official MongoDB C# driver. I can’t seem to find anything corresponding to the isMaster() method (used in the shell) in the driver. Isn’t there any way to detect if a server is master from C#?
Share
If you have a
MongoServer s, I believe you can just sayor
if I’m reading the API doc correctly.