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

BulkInsert/BulkInsertAsync with IEnumerable / IAsyncEnumerable #2956

Open
e-tobi opened this issue Feb 12, 2024 · 0 comments
Open

BulkInsert/BulkInsertAsync with IEnumerable / IAsyncEnumerable #2956

e-tobi opened this issue Feb 12, 2024 · 0 comments
Milestone

Comments

@e-tobi
Copy link
Contributor

e-tobi commented Feb 12, 2024

BulkInsert() currently consumes a IReadOnlyCollection. I think, it would be nice to allow IEnumerable too and even IAsyncEnumerable. This would allow to "stream" a large amount of documents into the database. I can provide a PR for this, if this is something that might get accepted

BTW: BulkInsertDocuments()/BulkInsertDocumentsAsync() already takes an IEnumerable, but I think this is misleading, because the documents will be grouped by type, causing the whole enumerable to be enumerated and loaded into memory. Having a potentially large data source, which provides an IEnumerable via yielding, this may cause trouble.

@jeremydmiller jeremydmiller added this to the 7.1.0 milestone Feb 28, 2024
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

No branches or pull requests

2 participants