Description
Currently the only way to use a positional operator & for updating a field in embedded array is to use the not type safe Update.Set with manually constructing the statement like:
Update.Set("MyArray.$.Value", newVal); |
A method can be added to the generic Update<TDocument> and UpdateBuilder<TDocument> to avoid hard-codding strings (there is already similar approach with Query<T>.ElemMatch):
Update<MyDocument>.SetPositional(d => d.MyArray, a => a.Value, newVal);
|
Attachments
Issue Links
- duplicates
-
CSHARP-531 Support the $ positional operator when building a query for updating a collection
-
- Closed
-