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

$oid does not work with $ne

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.4
    • Querying
    • None
    • ALL
    • QuInt 8 08/28/15

    Description

      These two queries return a different result (executed in the mongo shell):

      > db.objects.find({ "_id" : { "$ne" : ObjectId("55dda2e17da396655548870b") } }).count()
      139
      > db.objects.find({ "_id" : { "$ne" : { "$oid" : "55dda2e17da396655548870b" } } }).count()
      140
      

      The first one is correct and the second - wrong - it also returns the object with that ID. Am I missing something or is this a bug?

      Attachments

        Activity

          People

            max.hirschhorn@mongodb.com Max Hirschhorn
            alien Boris Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: