setParameter Command

Setting Runtime Parameters

This command allows changes to be made at runtime for some internal options as well some of the Command Line Parameters.

This command was added in 1.8 but some of the options have changed since then. Please pay attention to the version when they were made available.

> db.adminCommand({setParameter:1, option1:true, ...})
// real example to increase logging
> db.adminCommand({setParameter:1, logLevel:4})
//disallow table/collection scans
> db.adminCommand({setParameter:1, notablescan:true})
{ "was" : false, "ok" : 1 }
> db.foo.insert({_id:1, name:false})
> db.foo.find()
{ "_id" : 1 , "name" : false }
> db.foo.find({name:true})
error: { "$err" : "table scans not allowed:test.foo", "code" : 10111 }
> db.adminCommand({setParameter:1, notablescan:false})
{ "was" : true, "ok" : 1 }
> db.foo.find({name:true})
Options
option value description version available
syncdelay number period between memory flushes 1.8
logLevel int (0-5) sets logging level 1.8
traceExceptions true/false logs stack trace on assert/error 2.1
quiet true/false sets logging quiet mode (more details) 1.8
notablescan true/false causes error if a table scan is required 1.8
journalCommitInterval number (1-500 ms) journal (group) commit window 1.9.1

Getting Parameter States

Much like the ability to set runtime parameters you can also get them.

> db.adminCommand({getParameter:1, syncdelay:true})
{ "syncdelay" : 60, "ok" : 1 }

Follow @mongodb

MongoDB Pittsburgh - May 15
MongoNYC - May 23
MongoDB Paris - Jun 14
MongoDB UK - Jun 20
MongoDC - June 26


Labels

command command Delete
setparameter setparameter Delete
getparameter getparameter Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.

blog comments powered by Disqus