Change {$ne: null} semantics to be more intuitive

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Query Execution
    • Major Change
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      {$ne: null} has some counterintuitive behavior which has hurt us several times now:

      db.c.insert({a: [1, {c: 1}]});
      db.c.insert({a: [1]});
       
      db.c.find({"a.b": {$exists: true}}) // Returns nothing.
      db.c.find({"a.b": {$ne: null}}) // Returns {a: [1]} !!!!
      

      That is, {$ne: null} doesn't necessarily return a subset of the things that {$exists: true} returns. This ticket is to track the work of changing the meaning of {$ne: null}.

              Assignee:
              [DO NOT USE] Backlog - Query Execution
              Reporter:
              Ian Boros
              Votes:
              2 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated: