[GODRIVER-2291] Add Iterator types for bsoncore.Document and bsoncore.Array Created: 31/Jan/22 Updated: 30/Mar/22 |
|
| Status: | Backlog |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The bsoncore.Document#Elements and bsoncore.Array#Values functions return []Element and []Value, respectively. This API offers convenience at the expense of memory efficiency as it requires all Value/Element structs to be allocated at once. For use cases where memory management is critical, it might be worth adding Iterator types that return a single Value/Element at a time, thereby limiting the amount of memory that needs to be allocated at one point. |