Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2704

findAndModify upsert Beahavior Clarification

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • v1.3.3
    • None
    • manual

    Description

      The docs for the "upsert" parameter are incomplete. They state what will happen if the "query" parameter matches no documents, but they don't say what would happen if the "query" parameter does match some documents.

      I wrote some code that assumed it worked as documented. I thought it was stupid that an upsert operation only did inserts and not updates, but I figured someone had just chosen a bad parameter name. I was wrong. It works as intended, but not as documented.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            rrodkey@igodigital.com Ralph Rodkey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 44 weeks, 5 days ago