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

Allow specification of new document in findAndModify in upsert operation

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      all
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            keithbranton Keith Branton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: