timestamps options does not work as expect in subdocuments when using Model.bulkWrite to do updateMany operator. #13611
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
7.3.4
Node.js version
v14.21.3
MongoDB server version
6.0.6
Typescript version (if applicable)
5.1.6
Description
Following the documentation Disabling Timestamps
There are two issues:
Runtime issue. Try to disable updating the timestamps on the
post
subdocuments. But theupdatedAt
is still updated after setting thetimestamps
option tofalse
.Compile time issue. When setting the
timestamps
option, TSC throws an error:When I checkout the type, there is no
timestamps
property on theUpdateManyModel
interface.Steps to Reproduce
Logs:
As you can see,
2023-07-14T10:03:00.285Z
has been changed to2023-07-14T10:03:00.857Z
Expected Behavior
The
updatedAt
should stay the same after updating.The text was updated successfully, but these errors were encountered: