[DOCS-7935] db.collection.update discrepancy with upsert Created: 21/May/16 Updated: 11/Jan/17 Resolved: 07/Jul/16 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Kevin Arhelger | Assignee: | Jonathan DeStefano |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Participants: | |||||
| Days since reply: | 7 years, 31 weeks, 6 days ago | ||||
| Description |
|
https://docs.mongodb.com/manual/reference/method/db.collection.update/#behavior It appears that
might be implicitly rewritten as
resulting in unexpected behavior. This is probably worth testing in an older version (is the behavior consistent in 2.6.1?). |
| Comments |
| Comment by Githook User [ 07/Jul/16 ] |
|
Author: {u'username': u'jdestefano-mongo', u'name': u'jonathan', u'email': u'jonathan.destefano@10gen.com'}Message:
Signed-off-by: kay <kay.kim@10gen.com> |
| Comment by Githook User [ 07/Jul/16 ] |
|
Author: {u'username': u'jdestefano-mongo', u'name': u'jonathan', u'email': u'jonathan.destefano@10gen.com'}Message:
Signed-off-by: kay <kay.kim@10gen.com> |
| Comment by Githook User [ 07/Jul/16 ] |
|
Author: {u'username': u'jdestefano-mongo', u'name': u'jonathan', u'email': u'jonathan.destefano@10gen.com'}Message:
Signed-off-by: kay <kay.kim@10gen.com> |
| Comment by Jonathan DeStefano [ 17/Jun/16 ] |
|
It turns out that if the update parameter contains only field and value pairs those will be set. In addition, if the query parameter contains a specific value for the "_id" field, the "_id" field will be set in the new document, but any remaining query field and value pairs will be discarded. Verified in 2.6.1 and 3.2.7 |
| Comment by Jonathan DeStefano [ 17/Jun/16 ] |
|
Verified Abdul's comment, <update> and <query> parameters are used whether and update operator is used or not. Will work on testing in 2.6.1 as suggested. |