[CDRIVER-2494] Add a function to retrieve the key length on a bson_iter_t Created: 05/Feb/18 Updated: 07/Oct/21 Resolved: 31/Aug/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Kevin Albertson | Assignee: | Kevin Albertson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
bson_iter_t knows the key length of the current element. It computes the key length in _bson_iter_next_internal
And it does not change d1. So iter.d1 - iter.key (plus one?) should be the length of the key. |
| Comments |
| Comment by Kevin Albertson [ 31/Aug/18 ] |
|
Done in |
| Comment by A. Jesse Jiryu Davis [ 15/Feb/18 ] |
|
Might optimize C++ driver iterator patterns. Waiting for a prototype with the C++ driver to verify the need. |