Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4182

Extra dot operator for element wise aggregation expressions

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Kevin Albertson
            Reporter:
            eis@isi.fhg.de Stephan Müller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: