Extra dot operator for element wise aggregation expressions

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I would like to use the $set operator and dot notation to update embedded array elements, using corresponding old elements.

       

      However, if the field is member of an array by selecting it you are selecting all of them.

      {{{ar :[

      {"a" : 1}

      ,

      {"a" : 2}

      ]}}}

      "$ar.a" = [1 ,2]

      {{}}

      Suggestions:

      a) Extra dot operator for element wise access:

      {{}}{{"$ar:a" = 1     (for one case and 2 for the other )
      }}

      b) Suppport of positional operator in $set stage

      "$ar.$.a"

      {{}}

      {{Also see
      }}{{}}

      https://stackoverflow.com/questions/69494035/how-to-use-set-and-dot-notation-to-update-embedded-array-elements-using-corresp/69499878#69499878

            Assignee:
            Kevin Albertson
            Reporter:
            Stephan Müller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: