Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1587

$exists:false not working correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.9.0
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Ubuntu 10.4 64-bit
    • Backwards Compatibility:
      Major Change
    • Operating System:
      Linux

      Description

      When running a query with an $exists, a value of false causes the query to return 0 results.

      db.foo.find({value:{$exists:false}});

      The only fix I found was using $not with an $exists:true

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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: