Matching results with empty path component don't make sense

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Query Language
    • Query Optimization
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > db.foo.find({'x.': 1})
      { "_id" : ObjectId("6061e7ac7cc9a947848c1015"), "x" : [ 1 ], "y" : [ { "" : 1 } ] }
      { "_id" : ObjectId("6061e7f27cc9a947848c1016"), "x" : { "" : [ 1 ] }, "y" : [ { "" : 1 } ] }
      > db.foo.find({'y.': 1})
      >
      

      If we aren't going to error when there is an empty path component, the results should at least make sense. I can't think of any reason (modulo bugs of course) why the first document would match {'x.': 1}. And the second document should either match both or neither of {'x.': 1} and {'y.': 1}. The current behavior where it matches one but not the other is odd.

              Assignee:
              [DO NOT USE] Backlog - Query Optimization
              Reporter:
              Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: