Skip to content

RUST-1133 Update driver to use the raw BSON API #546

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

Merged

Conversation

patrickfreed
Copy link
Contributor

RUST-1133

We implemented some of the raw BSON functionality in the driver itself as a temporary measure until the BSON library had its own support for it. Now that it does, we can remove these driver-only implementations and update to use the BSON library's versions instead.

let id = match bson_util::raw_get(doc.as_slice(), "_id")? {
Some(b) => b,
let mut doc = bson::to_raw_document_buf(d)?;
let id = match doc.get("_id")? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up using basically the same prepend _id logic here.

Copy link
Contributor

@abr-egn abr-egn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@patrickfreed patrickfreed merged commit 48ee18e into mongodb:master Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants