2

当我输入 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() 显示。

4

1 回答 1

1

找到我们更多关于命令的一种方法是在不带括号的情况下调用它以查看 javascript :)

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

于 2012-04-11T07:38:42.970 回答