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

MongooseBulkWriteOptions is missing the strict flag #14234

Closed
2 tasks done
juona opened this issue Jan 5, 2024 · 0 comments · Fixed by #14239
Closed
2 tasks done

MongooseBulkWriteOptions is missing the strict flag #14234

juona opened this issue Jan 5, 2024 · 0 comments · Fixed by #14239
Labels
typescript Types or Types-test related issue / Pull Request
Milestone

Comments

@juona
Copy link

juona commented Jan 5, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

8.0.3

Node.js version

18

MongoDB server version

5

Typescript version (if applicable)

N/A

Description

I noticed that Mongoose was removing keys from update operations when using bulkWrite. A quick search led me to this: #8778. It seems that a strict flag was exposed on MongooseBulkWriteOptions to address the problem, but later versions removed it again.

I checked and the flag is still used in the code, and if I bypass type checks it actually works!

Is this an intentional reversal? If not, I propose to restore the type.

Steps to Reproduce

Expected Behavior

No response

vkarpov15 added a commit that referenced this issue Jan 6, 2024
@vkarpov15 vkarpov15 added this to the 8.0.4 milestone Jan 6, 2024
@vkarpov15 vkarpov15 added the typescript Types or Types-test related issue / Pull Request label Jan 6, 2024
vkarpov15 added a commit that referenced this issue Jan 7, 2024
types(model): add missing `strict` property to `bulkWrite()` top level options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants