[CDRIVER-4182] Extra dot operator for element wise aggregation expressions Created: 11/Oct/21  Updated: 15/Feb/22  Resolved: 15/Feb/22

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Stephan Müller Assignee: Kevin Albertson
Resolution: Won't Do Votes: 0
Labels: needs-first-responder
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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



 Comments   
Comment by Kevin Albertson [ 15/Feb/22 ]

Hello eis@isi.fhg.de the CDRIVER project is for bugs or feature requests for the MongoDB C driver. This is a feature request for the MongoDB server.

To suggest a New Feature for the MongoDB server, please visit https://feedback.mongodb.com.

Comment by Esha Bhargava [ 01/Nov/21 ]

eis@isi.fhg.de Thank you for reporting this issue! We'll look into it and get back to you soon.

Generated at Wed Feb 07 21:20:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.