[SERVER-8025] shell supports "query" works as a meta-operator - only "$query" should be supported Created: 24/Dec/12  Updated: 06/Aug/15  Resolved: 06/Aug/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.0.6, 2.2.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jack Wang Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux


Issue Links:
Depends
Duplicate
is duplicated by SERVER-8703 $all does not return document when se... Closed
is duplicated by SERVER-11864 $in operator fails if document field ... Closed
Related
is related to SERVER-9812 User query is interpreted incorrectly... Closed
is related to SERVER-6767 Interpret $query as special so you ca... Closed
Operating System: ALL
Steps To Reproduce:

connecting to: test
> db.a.drop();
true
> db.a.insert({a: 1});
> db.a.insert({a: 2});
> db.a.insert({a: 3});
> db.a.find({q:1});
> db.a.find({query:1});
> db.a.find({query:{}});
{ "_id" : ObjectId("50d7a88bd49137e7c8a0658a"), "a" : 1 }
{ "_id" : ObjectId("50d7a890d49137e7c8a0658b"), "a" : 2 }
{ "_id" : ObjectId("50d7a893d49137e7c8a0658c"), "a" : 3 }
> db.a.find({query:{a:1}});
{ "_id" : ObjectId("50d7a88bd49137e7c8a0658a"), "a" : 1 }
>

Participants:

 Description   

query result all



 Comments   
Comment by David Storch [ 06/Aug/15 ]

Per rassi@10gen.com's comment above, closing this ticket as a duplicate of SERVER-15176 ("New commands for find and getMore"). Please watch the find/getMore commands ticket for updates on the status of that project.

Comment by J Rassi [ 28/May/15 ]

We expect this to be resolved by the introduction of the find command in SERVER-15176. Running db.collection.find({query: {}}) in the shell will correctly match documents where the field "query" is an empty document.

Comment by Ben Becker [ 26/Feb/14 ]

Note that even with the workaround of specifying the $query operator, you still can't call .sort(). You have to specify $orderby in the find clause.

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