-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CXX-3077 BSON Binary Vector accessor, sub_binary builder #1356
Open
mdbmes
wants to merge
81
commits into
mongodb:master
Choose a base branch
from
mdbmes:CXX-3077
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,684
−75
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eramongodb
requested changes
Mar 21, 2025
.evergreen/config_generator/components/funcs/install_c_driver.py
Outdated
Show resolved
Hide resolved
mdbmes
commented
Mar 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the great suggestions.
.evergreen/config_generator/components/funcs/install_c_driver.py
Outdated
Show resolved
Hide resolved
…binary-fwd.hpp Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
…d.hpp Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
This reverts commit 3422b2e.
….hpp Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
eramongodb
approved these changes
Mar 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions remaining; otherwise, LGTM!
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/formats-fwd.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/accessor.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/accessor.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/elements.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/elements.hpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Co-authored-by: Ezra Chung <88335979+eramongodb@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a basic implementation of CXX-3077, adding
bsoncxx
support for the BSON Binary Vector specification.The main contribution in this PR is to add the
bsoncxx::vector
namespace, and especially thebsoncxx::vector::accessor
template. A vector accessor can wrap any validatedb_binary
value as read-only, or a mutable accessor can be obtained during append.General binary items can now be created and edited in-place during an append, using a new
sub_binary
basic builder.Bumps the Libmongoc version to an unreleased pre-2.0.0 snapshot, to get access to new Libbson features:
bson_append_binary_uninit
,bson_vector_*_const_view_init
, andbson_vector_*_binary_data_length
. Validation for existing and newly allocated vectors has been delegated to Libbson, to reuse as much of its testing as possible. The actual vector accessor template in bsoncxx has been implemented in a way similar to Libbson's vector views, but without a direct dependency.This implementation is currently less comprehensive than the Libbson implementation for BSON Binary Vector. No support is included for conversion between BSON arrays and BSON vectors, and there are no functions for bulk element conversion. Instead, a standard iterator interface allows access to individual elements or element ranges.
The spec includes JSON tests that are similar to bson_corpus. As with bsoncxx's approach to bson_corpus, this PR chooses to delegate those tests to the underlying Libbson implementation.