Mongodb using db.help() on a particular db command

Posted by user1325696 on Stack Overflow See other posts from Stack Overflow or by user1325696
Published on 2012-04-11T05:38:23Z Indexed on 2012/12/11 17:04 UTC
Read the original article Hit count: 273

Filed under:

When I type db.help() It returns

DB methods:
        db.addUser(username, password[, readOnly=false])
        db.auth(username, password)
...
...
        db.printShardingStatus()
...
...
        db.fsyncLock() flush data to disk and lock server for backups
        db.fsyncUnock() unlocks server following a db.fsyncLock()

I'd like to find out how to get more detailed help for the particular command. The problem was with the printShardingStatus as it returned "too many chunks to print, use verbose if you want to print"

mongos> db.printShardingStatus()
--- Sharding Status ---
  sharding version: { "_id" : 1, "version" : 3 }
  shards:
        {  "_id" : "shard0000",  "host" : "localhost:10001" }
        {  "_id" : "shard0001",  "host" : "localhost:10002" }
  databases:
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "dbTest",  "partitioned" : true,  "primary" : "shard0000" }
                dbTest.things chunks:
                                shard0001       12
                                shard0000       19
                        too many chunks to print, use verbose if you want to for
ce print

I found that for that particular command I can specify boolean parameter

db.printShardingStatus(true)

which wasn't shown using db.help().

© Stack Overflow or respective owner

Related posts about mongodb