[GODRIVER-528] Using a ReaderIterator, the current element holds onto the previous Document Created: 20/Aug/18  Updated: 27/Oct/23  Resolved: 22/May/19

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: 0.0.11
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ryan Hullah Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When calling iterator.Next(), it does not clear out the document of the value.  Simply doing the following should be sufficient:

itr.elem.value.d = nil

The side effect this has if for values that use the document (.d) like subdocuments and arrays, if you have multiples in the source (reader), it'll never update to the current element since the previous value was already set.



 Comments   
Comment by Divjot Arora (Inactive) [ 22/May/19 ]

The ReaderIterator type no longer exists.

Generated at Thu Feb 08 08:34:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.