Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2595

Allow specification of new document in findAndModify in upsert operation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      all

      Description

      It would be really helpful to be able to pass another optional parameter, (insert perhaps), of type document, to findAndModify that is used as the starting point if the query doesn't match an existing document and and upsert is enabled.

      i.e. the modifiers would be applied to it and then it would be inserted.

      I assume there is some smart logic applying the query to the inserted object just now - and maybe that should still be applied to the new document so it's unnecessary to restate the _id in the insert document.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: