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

$oid does not work with $ne

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.4
    • Component/s: Querying
    • Labels:
      None
    • ALL
    • QuInt 8 08/28/15

      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?

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

              Created:
              Updated:
              Resolved: