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

Create Array update code samples for MongoDB 3.6 page

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Description

      Please provide C# code for the following Java example :

      Array Updates

      // 3. Exploiting the power of arrays
      MongoCollection<Document> collection = client
        .getDatabase("test")
        .getCollection("arrayUpdatesTest");
       
      collection.updateOne(
        Filters.eq("_id", 1),
        Updates.set("a.$[i].b", 2),
       
      new UpdateOptions()
        .arrayFilters(
          Collections.singletonList(
            Filters.eq("i.b", 0))));
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: