Dependency graph loses nested path arrayness after later $project of collection field

XMLWordPrintableJSON

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

      When the inclusion projection of a collection field is not at the first position in the pipeline, the field inclusion logic for nested paths can lose the path arrayness of collection fields.

      This will not lead to an incorrect rewrite, but it is an omission and can be improved.

      // Assume path arrayness reports a.b.c is non-array.
      [{$match: {m: 1}}, {$project: {'a.b.c': '$x'}}] 

      We lose arrayness for 'a.b' and 'a.b.c', just 'a' remains as known non-array.

      canPathBeArray(nullptr, "a.b") -> true when it should be false

            Assignee:
            Vesko Karaganev
            Reporter:
            Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: