2012-04-11 32 views
2

當我鍵入db.help() 它返回MongoDB的使用db.help()在一個特定的數據庫命令

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

我想了解如何獲得更詳細的幫助的特定命令。問題是與printShardingStatus因爲它返回「太多塊打印,如果你想打印使用詳細」

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 

我發現,對於特定的命令,我可以指定布爾參數

db.printShardingStatus(true) 

這沒有使用db.help()顯示。

回答

1

一個辦法,找出我們更多的命令是調用它沒有括號看到的javascript :)

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

相關問題