[SERVER-7791] Commands wrapped in $query reports wrong error message for unrecognized commands Created: 28/Nov/12  Updated: 11/Jul/16  Resolved: 04/Apr/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.3.1
Fix Version/s: 2.3.2

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-7789 mapReduce on a sharded collection fai... Closed
is related to PYTHON-403 Don't use $query when querying agains... Closed
Operating System: ALL
Participants:

 Description   

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



 Comments   
Comment by Randolph Tan [ 04/Apr/13 ]

Fixed by this commit - The name of the command is correctly parsed (instead of simply getting the first BSON element)

Generated at Thu Feb 08 03:15:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.