[DOCS-1860] Comment on: "manual/reference/operator/exists.txt" Created: 28/Aug/13  Updated: 03/Nov/17  Resolved: 25/Sep/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: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 13.04, 64-bit. MongoDB version 2.4.3.

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


Participants:
Days since reply: 10 years, 21 weeks ago

 Description   

In my installation of MongoDB 2.4.3, using $exists as part of an $elemMatch subquery returns elements with fields that exist but are null. This seems contrary to the behavior described in the documentation.

Here's the excerpt from my MongoDB session:

> db.rewards.findOne({ funds: { $elemMatch: { transactionHash: "915711f675abda802886039388f00feacbeaed843555fd173ca411d39bd30fa4", approved: {$exists: true}, }}})
{
"_availableFundAmounts" : [ ],
"_availableFundPayoutAmounts" : [ ],
"_expires" : ISODate("2013-11-26T22:02:12.012Z"),
"_id" : "5b76f2c5bbe1cb10ccc5ee4a",
"currency" : "btc",
"funds" : [

{ "_id" : "89d232cef8542043c985d0f5", "address" : "1LYR9bgHjmXWUmPiz31xdMeMJEC9tp6HwZ", "amount" : "0.05", "approved" : null, "currency" : "btc", "details" : null, "expires" : ISODate("2013-11-26T22:02:12.012Z"), "payoutAmount" : "0.045", "processor" : "blockchain.info", "proxyAddress" : "14CkgPtryYc7bRr8RVA1nKLz91Q5bwErEq", "refunded" : null, "transactionHash" : "915711f675abda802886039388f00feacbeaed843555fd173ca411d39bd30fa4", "userId" : "3bSKsLAhh4LyX4utR" }

],
"issueUrl" : "https://github.com/codebounty/codebounty/issues/96",
"lastSync" : ISODate("2013-08-28T23:05:21.420Z"),
"log" : [ ],
"payout" : null,
"receivers" : [ ],
"status" : "open",
"userId" : "3bSKsLAhh4LyX4utR"
}



 Comments   
Comment by auto [ 25/Sep/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1860 clarifying examples of $exists
Branch: master
https://github.com/mongodb/docs/commit/d8946bb5d96e2d1743765eb0a94f45bc755c9c2e

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