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_減少重複。 –