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

The use of UpdateOneModel on MongoCollection#updateOne

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: