$oid does not work with $ne

XMLWordPrintableJSON

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

      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
              Reporter:
              Boris Petrov
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: