Implement path prefix rename using the DependencyGraph

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This may be best illustrated with an example:

      {$set: {a: '$x'}}
      

      Assuming x is not defined anywhere and comes from the collection.
      Also assume x is not array and x.y is not array.

      We should be able to resolve a.y as non-array.

      pathArrayness.canPathBeArray("a.y");
      

      We need two things to do this:
      1. We need to store metadata to indicate that a is an alias for b (I propose we use the term "alias" within the graph to mean rename without traversal, since "rename" is very overloaded). This is mostly trivial, but requires consideration of shadowing cases.

      2. We need to be able to rewrite the path during lookup, meaning, if we lookup a.y, and we find a as an alias for a collection field, we need to take the path a.y and lookup the path arrayness API. This can be done by accumulating the traversed path during lookup or by storing the field name (path component) together with the field, so we can look back the path.

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

              Created:
              Updated:
              Resolved: