[DOCS-2191] undocumented behaviour or bug of db.collection.save (E11000 duplicate key error) Created: 05/Nov/13 Updated: 11/Jan/17 Resolved: 05/Nov/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jaromir Muller [X] | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 10 years, 15 weeks ago |
| Description |
|
Hello, recently I created a question in stackoverflow http://stackoverflow.com/questions/19787803/mongo-throws-e11000-duplicate-key-error-whey-i-try-to-do-db-collection-save-oper?noredirect=1#comment29414789_19787803 related to behaviour of function db.collection.save when I try to do insert/replace chunk of documents. I created the scenario
The documentation does no say anything about using array of documents. Is it bug or ambiguous documentation? Thank you, JM |
| Comments |
| Comment by Jaromir Muller [X] [ 06/Nov/13 ] |
|
I agree with answer on SF, at least it makes sense. But I think it would fail when anything else then document is passed to db.collection.save. So db.collection.save ( [ doc1, doc2 ] ) should fail. |
| Comment by Sam Kleinman (Inactive) [ 05/Nov/13 ] |
|
The question has been answered on stack overflow, and the answer is consistent with the documentation for the save method. http://docs.mongodb.org/manual/reference/method/db.collection.save/#db.collection.save |