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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -