[DOCS-2704] findAndModify upsert Beahavior Clarification Created: 10/Feb/14  Updated: 11/Apr/14  Resolved: 11/Apr/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.3

Type: Improvement Priority: Major - P3
Reporter: Ralph Rodkey Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: http://docs.mongodb.org/manual/reference/command/findAndModify/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
Referrer: https://www.google.com/
Screen Resolution: 1440 x 900
repo: docs
source: reference/command/findAndModify


Participants:
Days since reply: 9 years, 44 weeks, 5 days ago

 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.



 Comments   
Comment by Githook User [ 11/Apr/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-2704 clarify upsert definition and reformat command
Branch: master
https://github.com/mongodb/docs/commit/a9c51558b082b71c8b849f0c6770e6f538cf3c56

Generated at Thu Feb 08 07:44:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.