[SERVER-1173] GetLastError After Upsert Should Include New _id Created: 29/May/10 Updated: 12/Jul/16 Resolved: 24/Jun/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.5.3 |
| Fix Version/s: | 1.5.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The lastErrorObject should contain the newly inserted _id value from the upsert. > db.test.update( {foo:1}, {$set:{blah:1}}, 1, 1) > db.test.find() { "_id" : ObjectId("4c0155b806510000000000e7"), "blah" : 1, "foo" : 1 }I would expect the lastErrorObject to look something like this: { "err" : null, "updatedExisting" : false, "n" : 1, "ok" : true, inserted_id: ObjectId("4c0155b806510000000000e7")} |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 24/Jun/10 ] |
|
upserted { |
| Comment by Scott Hernandez (Inactive) [ 24/Jun/10 ] |
|
What is the name of the field returned? "id" ? |