insertMany does not take nested/subdocument schema into account for timestamps #12060
Closed
2 tasks done
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
6.1.5
Node.js version
16.13.0
MongoDB server version
4.4.12
Description
insertMany adds
createdAt
andupdatedAt
iftimestamps: true
for parent document but not for child document with the same settings.It honors
_id: false
for both parent and child documents, so I would expect this is just a bug.I did a search for existing issues and came across one but it seems no follow-up issue was ever created: #4155 (comment)
Steps to Reproduce
Expected Behavior
I would have expected the nested/subdocument to also have its schema options of
timestamps: true
honored when inserting.The text was updated successfully, but these errors were encountered: