[CDRIVER-3100] bson_iter_value API is unfriendly Created: 25/Apr/19  Updated: 09/Feb/23

Status: Backlog
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-3158 Update documentation for bson_iter_va... Closed
Epic Link: Improve Developer Experience

 Description   

bson_iter_value returns a bson_value_t to the caller, but the returned value is a reference to an internal member of the iterator.  This means that if the iterator gets destroyed, the caller's reference is invalidated.  This also means that if the internal state of the iterator changes (for example, from a second call to bson_iter_value) the first value returned to the caller can be altered underneath them.

 

Let's design a friendlier API that allows the caller to pass in a bson_value_t* that they control, which can be populated with pointers directly into the underlying bson buffer instead of relying on the bson_iter_t as an intermediary.


Generated at Wed Feb 07 21:17:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.