MongoDB的文档$cmd
定义如下:
A special virtual collection that exposes MongoDB’s database commands. To use database commands, see Issue Commands.
而在Issue Commands部分:
running commands with
db.runCommand()
is equivalent to a special query against the$cmd
collection
但是当我发出这个查询对$cmd
集合:
db.$cmd.find({isMaster: 1})
我出现以下错误:
{ "ok" : 0, "errmsg" : "bad numberToReturn (0) for $cmd type ns - can only be 1 or -1", "code" : 16979 }
无论如何,$cmd
集合是什么?以及如何正确地针对它发出查询?
可能欺骗http://stackoverflow.com/questions/28642311/ – chridam
@chridam对此也没有答案! –
这不会让你的_question_减少重复。 –