Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1446

Create Array update code samples for MongoDB 3.6 page

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.6.1
    • Affects Version/s: None
    • Component/s: None
    • None

      Please provide Python
      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))));
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: