[SERVER-10958] Provide _id and error for failed document from multi-update Created: 30/Sep/13 Updated: 11/Jul/16 Resolved: 08/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | jayakrishnan | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | error-messages, getlasterror | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.04 LTS 64 bit |
||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
When i do update operation with more than one condition, if condition fails i can check whether update succeded or failed using getLastError. |
| Comments |
| Comment by auto [ 08/Oct/13 ] |
|
Author: {u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Scott Hernandez (Inactive) [ 03/Oct/13 ] |
|
Okay, then this isn't really what you are asking for. Please ask your question about your language/driver on the mongodb-user forum (https://groups.google.com/group/mongodb-user) as that is where you are going to get a typed exception or error message you can act on in your application code. If you are calling getLastError manually you should be using a write concern instead in your application code. |
| Comment by jayakrishnan [ 02/Oct/13 ] |
|
I am developing a application for project management tool (web app) . I have a collection of "projects".Following is a document which represents a project db.update({_id:"projectId", owner: "userId"}, {"$set": {"name": "new-name"}}); update can be failed due to wrong _id or unauthorized access. I am not talking about multi update. |
| Comment by Scott Hernandez (Inactive) [ 30/Sep/13 ] |
|
@jayakrishnan , I've updated this to be what I think you were asking for, which is how to find the document which caused the update failure. Please add an example if you have one so we can confirm this is what you want, and if possible please provide an example of what you want to see as an error. |