nosql - MongoDb C# driver - test authentication mode -


using c# mongodb driver, there way query server find out if started with:

mongod --auth or mongod?

thanks.

there ticket on mongodb tracker indicating getcmdlineopts command can used auth mode of server.

db.runcommand("getcmdlineopts") 

returns

{   "argv" : [      "mongod",      "--config",      "mongodb.conf"   ],   "parsed" : {     "auth" : "true",     "config" : "mongodb.conf",     ...   },   "ok" : 1 } 

if --auth passed on command line appear in argv , parsed nodes; if set in mongodb.conf only appear in parsed node.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -