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

Queries with $exists operator on indexed key return on results

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.1.4
    • Affects Version/s: 1.0.0, 1.0.1
    • Component/s: Querying
    • None
    • Environment:
      Mac OS X 10.5.8 on MacBook Pro
      Tested on MongoDB releases mongodb-osx-x86_64-1.0.0 and mongodb-osx-x86_64-1.0.1

      It seems that the $exists operator does not work on keys which have been indexed. If a key has an index, the $exists operator will never return any documents. I've attached some tests in ruby which demonstrate this, along with their output, and an example mongo console session showing that it's not just an issue with the ruby driver.

        1. mongo_problem_spec.rb
          2 kB
          Emily Price

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            duien Emily Price
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: