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

[CQF] match with $ne is ignoring non literal values (and null)

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization

      db.test.insert({"_id": 1, x:1})
      db.test.insert({"_id": 2, x:{y:1}})
      db.test.insert({"_id": 3, x:2})
      db.test.insert({"_id": 4, x:null})
      assert.sameMembers(db.test.aggregate([{$match: {x: {$ne: 1}}}]).toArray(),
       [
          {"_id": 1, x:1},
          {"_id": 2, x:{y:1}},
          {"_id": 3, x:2},
       ])
       

      it returns only 

       { "_id" : 3, "x" : 2 } 

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            ruslan.abdulkhalikov@mongodb.com Ruslan Abdulkhalikov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: