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

[CQF] Dotted path equality to null incorrectly matches non-object array elements

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

      The following query incorrectly returns the one document when run through CQF:

      coll.insert({a: [5]});
      assert.eq(0, coll.find({'a.b': null}).itcount());
      

      The semantics are that if the leading path resolves to an object, then the `b` field of that object must be null/missing. But in this case, the leading path `a` does not find an object even with implicit array traversal so the command should return 0 documents.

      The existing test that exercises this is here.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: