2012-04-11 6 views
2

Lorsque je tape db.help() Il retourneMongoDB en utilisant db.help() sur une commande particulière db

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() 

Je voudrais savoir comment obtenir une aide plus détaillée pour la commande particulière . Le problème était avec le printShardingStatus comme il est revenu « trop de morceaux à imprimer, utilisez bavard si vous voulez imprimer »

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 

Je trouve que, pour cette commande particulière, je peux spécifier le paramètre booléen

db.printShardingStatus(true) 

qui n'a pas été montré en utilisant db.help().

Répondre

1

Une façon de trouver notre plus sur une commande est de l'appeler sans les parenthèses pour voir le javascript :)

rs:PRIMARY> db.printShardingStatus 
function (verbose) { 
    printShardingStatus(this.getSiblingDB("config"), verbose); 
} 
rs:PRIMARY 

Questions connexes