[CXX-1499] Don't access bson_iter_t internals Created: 23/Jan/18  Updated: 28/Oct/23  Resolved: 01/Aug/18

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.4.0

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-2467 Provide a way to synthesize a bson_it... Closed
depends on CXX-1498 Upgrade to C driver 1.10 Closed
Epic Link: libbson iter api

 Description   

We current access the internals of the bson_iter_t structure (see CDRIVER-2467 for details). Once the C driver provides a mechanism to address this, use it.]

Let's add a libbson function bson_iter_keylen which returns the length of the key. This is already known, it's something like "key - d1". The C++ iterator can store this length before destroying the bson_iter_t, then pass it back into a new libbson function like bson_iter_init_with_data. That will end up doing only one key-length calculation per iterator increment, whereas right now the C++ Driver does two.



 Comments   
Comment by Githook User [ 01/Aug/18 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CXX-1499 Don't access bson_iter_t internals
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/e0b9d1db99d6674d1f2074368f4c75004e3e0840

Generated at Wed Feb 07 22:02:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.