The mongod implementation of the count command parses the request using a utility called CountRequest (see https://github.com/mongodb/mongo/blob/r3.3.10/src/mongo/db/commands/count_cmd.cpp#L141). The mongos implementation, however, has old parsing code which was never ported to use CountRequest:
https://github.com/mongodb/mongo/blob/r3.3.10/src/mongo/s/commands/cluster_count_cmd.cpp#L110-L128
This is bad because it means there is more code to maintain and makes it more likely that the two implementations will get out of sync. Therefore, the mongos implementation should be updated to also use CountRequest.
- is related to
-
SERVER-45253 Sharded cluster count command doesn't throw errors on invalid options
- Closed
- links to