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

Matching results with empty path component don't make sense

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Query Language
    • Labels:
      None
    • Operating System:
      ALL

      Description

      > 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.

        Attachments

          Activity

            People

            Assignee:
            backlog-query-optimization Backlog - Query Optimization
            Reporter:
            redbeard0531 Mathias Stearn
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: