-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.5
-
Component/s: Feature Request
The feature to add strongly typed LINQ support to the builders doesn't suppport updating of nested collections.
For example, it's possible to write an update like:
statusCollection.Update(
Query<StatusGroup>.Where(sg => sg.Statuses.Any(s => s.Id == status.Id)),
Update.Set("Statuses.$.UpdateTime", DateTime.Now)
.Set("Statuses.$.Name", "name")
);
It would be nice if it was possible to write something like:
statusCollection.Update(
Query<StatusGroup>.Where(sg => sg.Statuses.Any(s => s.Id == status.Id)),
Update<StatusGroup, Status>.Set(sg => sg.Statuses, s => s.UpdateTime, DateTime.Now)
.Set(sg => sg.Statuses, s => s.Name, "name")
);
Eventually it would be nice to support multi-level nested collections but that might be dependant on https://jira.mongodb.org/browse/SERVER-831
- is duplicated by
-
CSHARP-588 Strong typed generic functions for inner document updates
- Closed
-
CSHARP-1046 Type-safe $set with positional operator "$"
- Closed