Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1860

Comment on: "manual/reference/operator/exists.txt"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • None

    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"
      }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            auto auto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 21 weeks ago