-
Notifications
You must be signed in to change notification settings - Fork 185
RUST-2078 Support QE with bulk write #1445
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
Conversation
d1f4e71
to
d752bd4
Compare
src/bson_util.rs
Outdated
fn push(&mut self, doc: RawDocumentBuf); | ||
|
||
/// Adds the collection of raw documents to the provided command. | ||
fn add_to_command(self, identifier: &'static CStr, command: &mut Command); |
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.
Extremely minor nit: I don't think this needs the 'static
?
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.
it does not, updated!
src/operation/bulk_write.rs
Outdated
let index = self.cache.len(); | ||
let bytes_added = T::bytes_added(index, &namespace_doc)?; | ||
self.pending_namespace = Some(namespace_doc); | ||
self.cache.insert(namespace, index); |
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.
I know in current usage it doesn't matter because a pending document not being added terminates the outer loop, but it still bugs me that the namespace is added to the cache even if add_pending
is never called. Not sure what a good way to fix that would be, though.
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.
updated to defer adding to the cache til add_pending
is called
Implements mongodb/specifications#1770