-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Bulk operations not including shardKey #14622
Milestone
Comments
This was referenced Jun 22, 2024
This was referenced Jun 22, 2024
This was referenced Jul 17, 2024
This was referenced Jul 18, 2024
This was referenced Jul 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.x.x
Node.js version
20.x.x
MongoDB server version
7.x
Typescript version (if applicable)
No response
Description
When having a sharded collection and having set shardKey on the schema, using buildBulkWriteOperations does not take the shardKey into account.
Steps to Reproduce
when using running
This will execute a bulkWrite without the shardKey as a part of the filter condition in the updateOne command of the bulkWrite.
While this current solution will work (as ObjectIds are universally unique), including the shardKey in update will enable the to the executed on a single shard.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: