[DOCS-4173] Comment on: "manual/reference/operator/query/exists.txt" Created: 13/Oct/14  Updated: 03/Nov/17  Resolved: 14/Oct/14

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mongodb Version 2.6.3

Location: http://docs.mongodb.org/manual/reference/operator/query/exists/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1920 x 1080
repo: docs
source: reference/operator/query/exists


Issue Links:
Related
is related to DOCS-1560 Document behavior of using the field ... Closed
Participants:
Days since reply: 9 years, 18 weeks, 2 days ago

 Description   

If I try to execute this command
....find({"query": {$exists: true}}) on version 2.6.3 I get this error
error: {
"$err" : "Can't canonicalize query: BadValue unknown top level operator: $exists",
"code" : 17287
}
But If I execute this same command on version 2.4.6 It works fine.



 Comments   
Comment by Kay Kim (Inactive) [ 14/Oct/14 ]

Hi Fabian –
Thanks for taking the time to file this ticket. If the field in the document is query, you need to use the
$query syntax like the following:

db.foo.find( { $query: { query: { $exists: true } } } )

There is an existing DOCS-1560 to document this. As such, will close this ticket as a duplicate.

Hope this helps.

Regards,

Kay Kim

Generated at Thu Feb 08 07:47:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.