ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0, 9.1.0-rc1025
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When we ask for a type of a dotted path defined in the graph, we currently use createDocumentFromLeafMatch.

      For example, if we have {$set: {'a.b': '$c'}}, where we know '$c' is a 'number',  we nest the 'number' type into the prefix to construct:

      Root = {a: array|scalar|{b: array|scalar|number}}

      This is not pointless, once we have this Root type, we can intersect it with collection schema and $match type inference to potentially remove the prefixes.

      We need to do the same for fields from the collection. Instead of returning directly getDocumentTypeFromCollection, we should use createDocumentFromLeafMatch the same as we do for the other cases.

      Please ensure the following works:

      SchemaType = {a: number|{b: number}}

      {$project: {'x.y': 1}}

      The type of 'x.y' should include missing, since if 'a' was a number, the inclusion would have removed it.

       

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

              Created:
              Updated:
              Resolved: