[CSHARP-600] Unrecognized command: $query Created: 11/Oct/12 Updated: 06/Nov/12 Resolved: 19/Oct/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.6 |
| Fix Version/s: | 1.6.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Thanks for the response Error message
Stacktrace
Environment:
We could not upgrade master & mongos to 2.2 atm so we have to try this approach as it's mentioned in the doc. Cheers |
| Comments |
| Comment by auto [ 06/Nov/12 ] | ||||||
|
Author: {u'date': u'2012-10-19T00:48:12Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: | ||||||
| Comment by auto [ 06/Nov/12 ] | ||||||
|
Author: {u'date': u'2012-10-18T18:19:08Z', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: | ||||||
| Comment by auto [ 06/Nov/12 ] | ||||||
|
Author: {u'date': u'2012-11-05T14:27:27Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: | ||||||
| Comment by Craig Wilson [ 19/Oct/12 ] | ||||||
|
Resolved and pushed to master. | ||||||
| Comment by auto [ 19/Oct/12 ] | ||||||
|
Author: {u'date': u'2012-10-18T17:48:12-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: | ||||||
| Comment by auto [ 19/Oct/12 ] | ||||||
|
Author: {u'date': u'2012-10-18T11:19:08-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: | ||||||
| Comment by auto [ 19/Oct/12 ] | ||||||
|
Author: {u'date': u'2012-10-18T08:56:10-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: | ||||||
| Comment by Craig Wilson [ 16/Oct/12 ] | ||||||
|
I was able to reproduce this with 1 mongos (2.0.7), 1 config server (2.2.0), and 1 mongod shard (2.2.0). This works when the mongos is 2.2.0. Below is the code:
The above produces the following json sent to the server: }] }, "$readPreference" : { "mode" : "primary" }}" I think the ultimate issue here is the attempt to use aggregation framework through a mongos < 2.2.0. The error message reported indicates that mongos doesn't like the $query parameter that exists because we need to pass the additional $readpreference parameter as well. Just as a test, I got rid of the wrapped query part so it wouldn't send the read preference. Below is the query sent: }] }" Of course this didn't work, because mongos 2.0.7 doesn't know about the aggregate command, so it didn't know what to do with it. I tested other commands, like collstats, and these worked just fine, so I believe the issue is solely with the use of the aggregation command in pre 2.2.0 mongos. |