Internal Commands

Most commands have helper functions and do not require the $cmd.findOne() syntax. These are primarily internal and administrative.

> db.$cmd.findOne({assertinfo:1})
{
    "dbasserted" : false , // boolean: db asserted
    "asserted" : false , // boolean: db asserted or a user assert have happend
    "assert" : "" ,  // regular assert
    "assertw" : "" , // "warning" assert
    "assertmsg" : "" , // assert with a message in the db log
    "assertuser" : "" , // user assert - benign, generally a request that was not meaningful
    "ok" : 1.0
}

> db.$cmd.findOne({serverStatus:1})
{ 
  "uptime" : 6 , 
  "globalLock" : {
                    "totalTime" : 6765166 , 
                    "lockTime" : 2131 ,
                    "ratio" : 0.00031499596610046226
                 } , 
   "mem" : {
                    "resident" : 3 , 
                    "virtual" : 111 , 
                    "mapped" : 32
   } , 
  "ok" : 1
}



> admindb.$cmd.findOne({replacepeer:1})
{
    "info" : "adjust local.sources hostname; db restart now required" ,
    "ok" : 1.0
}

// close all databases.  a subsequent request will reopen a db.
> admindb.$cmd.findOne({closeAllDatabases:1});

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

PLEASE POST QUESTIONS IN THE FORUMS: http://groups.google.com/group/mongodb-user. Post tips and clarifications here.

blog comments powered by Disqus