[SERVER-9523] _id not preserved when saving to different collection Created: 01/May/13 Updated: 10/Dec/14 Resolved: 01/May/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Boyd | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.10 |
||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Steps To Reproduce: | See description. I'm not sure if moving between db's (rather than within the same db) has anything to do with it. |
||||||||
| Participants: | |||||||||
| Description |
|
This statement did not preserve the _id's of the original (new ones were created): // move posts to the attic ).sort({_id:-1}).forEach( function(vouchPost) { I had to do this workaround to get the _id to remain unchanged in the new collection: // move posts to the attic ).sort({_id:-1}).forEach( function(vouchPost) { } |
| Comments |
| Comment by Aaron Boyd [ 01/May/13 ] |
|
Thank you. |
| Comment by J Rassi [ 01/May/13 ] |
|
This has already been reported, at |