Skip to content
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

feat mongo: Added Get/Set batch size for Mongo Cursor #312

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

botanegg
Copy link
Contributor

Add ability to get/set batchSize for mongo::Cursor

@@ -15,6 +15,10 @@ Cursor& Cursor::operator=(Cursor&&) noexcept = default;

bool Cursor::HasMore() const { return impl_->IsValid(); }

uint32_t Cursor::GetBatchSize() const { return impl_->GetBatchSize(); }

void Cursor::SetBatchSize(uint32_t size) { impl_->SetBatchSize(size); }
Copy link
Contributor Author

@botanegg botanegg Jun 21, 2023

Choose a reason for hiding this comment

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

Idea: Changing signature to Cursor & and return *this makes possible to write chaining methods like:

auto cursor = collection.Find(filter).SetBatchSize(N);

It is similar to mongo example syntax or Mongo Golang driver (StackOverflow)

@apolukhin
Copy link
Member

Looks very good. Please add some tests

@botanegg
Copy link
Contributor Author

It needs time to understand how utest and mongotest works :)

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.

None yet

2 participants