Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-588

Strong typed generic functions for inner document updates

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.6
    • Component/s: None

      Hi
      I've tried to perform an update of embedded document using new generic syntax, but didn't find any solution (only adding and deleting embedded documents in collections). I meen code like this:

      MongoCollection.Update(
      Query.And(Query<ReadDto.Concert>.EQ(ev => ev.Id, evnt.AggregateId),
      Query<ReadDto.Concert>.ElemMatch(item => item.LineupItems,
      builder =>
      builder.EQ(
      item => item.ArtistId,
      evnt.EntityObjectId))),
      Update.Set("LineupItems.$.Headliner", evnt.Headliner)
      .Set("ChangeDate", evnt.ChangeDate)
      .Set("Version", evnt.Version));

      Is it possible to construct such update using Update<>? And also it's not clear how to perform an update of embedded document which is single.

            Assignee:
            Unassigned Unassigned
            Reporter:
            nsushkov Nikita Sushkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: