db.$cmd.find({ $query: { count: 'user' }}).limit(-1).next()
works ok
db.$cmd.find({ secretCommand: 1 }).limit(-1).next()
gives you:
{ "$err" : "unrecognized command: secretCommand", "code" : 13390 }, which is expected.
while:
db.$cmd.find({ $query: { secretCommand: 1 }}).limit(-1).next()
gives you:
{ "$err" : "unrecognized command: $query", "code" : 13390 }, which is wrong
- is related to
-
PYTHON-403 Don't use $query when querying against the $cmd collection.
- Closed
- related to
-
SERVER-7789 mapReduce on a sharded collection fails with $readPreference
- Closed