[DOCS-1771] Comment on: "manual/reference/operator/exists.txt" Created: 02/Aug/13  Updated: 03/Nov/17  Resolved: 02/Aug/13

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

Type: Improvement Priority: Major - P3
Reporter: auto Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

version 2.4.5

Location: http://docs.mongodb.org/manual/reference/operator/exists/#op._S_exists
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.52 Chrome/28.0.1500.52 Safari/537.36
Referrer: http://docs.mongodb.org/manual/faq/developers/
Screen Resolution: 1680 x 1050
repo: docs
source: reference/operator/exists


Issue Links:
Related
is related to DOCS-1747 Comment on: "manual/faq/developers.txt" Closed
Participants:
Days since reply: 10 years, 28 weeks, 5 days ago

 Description   

> Documents that contain the field but has the value null are not returned.

It's not the case:

> db.test.insert({ _id: 1, cancelDate: null })
> db.test.find( { cancelDate : { $exists: false } } )
> db.test.find( { cancelDate : { $exists: true } } )
{ "_id" : 1, "cancelDate" : null }



 Comments   
Comment by Sam Kleinman (Inactive) [ 02/Aug/13 ]

$exists tests if a field is in a document, and shouldn't return documents that contain fields with null values. The documentation currently says the following:

"Documents that contain the field but has the value null are not returned."

I believe this is consistent with the above case.

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