[SERVER-1199] Iterating through a query result and adding new data to the queried objects results in iterating over some objects twice Created: 07/Jun/10 Updated: 07/Mar/14 Resolved: 07/Jun/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alan | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
GNU/Linux Ubuntu (Lucid) mongodb-unstable package (version 20100604) |
||
| Attachments: |
|
| Participants: |
| Description |
|
Iterating through a resultset and adding news fields to the objects results in a corrupted iterator. A simple test like the following code iterates many times over the same objects ... am I missing something? (see the attached file for a complete example)
print count,total_obj
script usage: |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 07/Jun/10 ] |
|
Your adding a field using $set, so that will make the object larger forcing a move. |
| Comment by Alan [ 07/Jun/10 ] |
|
thanks for your answer ... but from what I understand from the documentation, modifying objects should be fine as long as the '_id' is not modified and the size of the returned documents is not affected by the update (this is the case in my example) ... am I wrong? |
| Comment by Eliot Horowitz (Inactive) [ 07/Jun/10 ] |
|
this is known/expected behavior |