[SERVER-6254] FindAndModify throw exception if new:true is set Created: 29/Jun/12 Updated: 11/Jul/16 Resolved: 03/Jul/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 2.1.2 |
| Fix Version/s: | 2.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David O'Hara | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | findAndModify | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
Executing a findandmodify with the new:true option set causes exception to be thrown. Steps to repro: 1. Add document to collection "TestPeople" {"FirstName":"John"}2. Call FindAndModify with $set operator & true to return new document {query: {"FirstName":"John"},update:{$set:{"FirstName":"Tim"}},new:true} I've also included a screenshot of my console repro of the issue. |
| Comments |
| Comment by auto [ 03/Jul/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'date': u'2012-07-03T10:10:09-07:00', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Tad Marshall [ 29/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
This reproduces for me in Windows ... including stack trace since I have .PDB files ...
The code's logic seems flawed. We are using findAndModify to modify one of the fields that we used to locate the document, so it is natural that we can't find it again using the same keys ... we just changed the keys. It also repros the same way for me in Linux:
| |||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 29/Jun/12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
Can you send the server logs? I cannot reproduce this with 2.1.2 on my system.
|