-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
types(models): fix incorrect bulk write options #14513
types(models): fix incorrect bulk write options #14513
Conversation
3c0e1eb
to
f54f9d0
Compare
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.
Thanks 👍
@emiljanitzek @vkarpov15 FYI the Should I open a PR to revert that particular piece of this PR? Longer-term, probably makes sense to be consistent and remove |
Seems very dangerous to have a function wide option that only applies sometimes. It does make sense as an option but then it should be respected for updateOne/updateMany as well. Or rename the option to |
I also wonder if the same option should be included for |
@sderrow you're right, we should support the |
Summary
The
bulkWrite
options are incorrectly typed.timestamp
does not exists as an option onupdateOne
/updateMany
(there was a test but it didn't work, I fixed this as well). And the type incorrectly showed a timestamp as options tobulkWrite
, which doesn't work.Also extended the mongodb
BulkWriteOptions
making it easier to use theMongooseBulkWriteOption
without the need to also always extend mongodb.Examples
See fixed test