Incomplete argument types for Model.bulkWrite
#14072
Labels
typescript
Types or Types-test related issue / Pull Request
Milestone
Prerequisites
Mongoose version
8.0.0
Node.js version
18.8.0
MongoDB server version
4.4
Typescript version (if applicable)
4.5.2
Description
The argument types for
Model.bulkWrite
are missing a couple different things.The
writes
argument usesmongodb.AnyBulkWriteOperation[]
as its input type, butmongodb.AnyBulkWriteOperation
is missingupdateOne.timestamps
andupdateMany.timestamps
since that's a mongoose-specific optionThe
options
argument doesn't includetimestamps?: boolean
even though the implementation looks at that option to know whether to include timestamps forinsertOne
writes. I would argue that this option should actually belong in theinsertOne
object, just like it does forupdateOne
andupdateMany
, but at a minimum, the type and documentation should be updated to reflect the implementationSteps to Reproduce
Expected Behavior
None of the above 3 Typescript errors that currently appear.
The text was updated successfully, but these errors were encountered: