The runCommand doesn't mention if "use admin" is always required (in a sharded environment?).
use admin to successfully execute is certainly required a lot, so I believe this page should mention it.
http://docs.mongodb.org/manual/reference/method/db.runCommand/
Further more, this page doesn't mention that "use admin" is required:
http://docs.mongodb.org/manual/reference/command/addShard/#dbcmd.addShard
It is, and the error message with ZERO shards is:
mongos> db.runCommand(
)
Wed Feb 5 15:15:37.422 error: {
"$err" : "error creating initial database config information :: caused by :: can't find a shard to put new db on",
"code" : 10185
} at src/mongo/shell/query.js:128
Which is very hard to figure out.
Further shards require "use admin" but they kindly tell.
- related to
-
SERVER-12632 Misleading error
- Closed
-
SERVER-4021 Running "addshard" outside admin db produces cryptic error message
- Closed