Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3371

The use of UpdateOneModel on MongoCollection#updateOne

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: API
    • Labels:
      None
    • Environment:
      N/A

      Hey, I think it'd be cool if we were able to use the UpdateOneModel for MongoCollection#updateOne, I see this being pretty useful especially if you want to update a nested field based on if the document you're looking for is already there or not, so for one instance you'd use a push but the other you'd use a set one requiring an array filter and the other doesn't. Due to how it handles array filters if the array filter is unused it'll throw an exception, I think this would be a good way to avoid this as you can choose whether to have an array filter depending on the update.

            Assignee:
            john.stewart@mongodb.com John Stewart (Inactive)
            Reporter:
            sheacartwright4@gmail.com Shea Cartwright
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: