Date Objects not copied to new document when using Model Constructors & Strict: False Schema #7907
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Bug
Current behavior
Properties on objects that contain a value of type
Date
are not persisted to a document when passing an object into a model constructor, where the model is based off of a schema with thestrict: false
option set. This previously worked in version 5.5.1Steps to reproduce.
What is the expected behavior?
I expect the following to be logged out & saved to DB:
Instead I get the following:
What are the versions of Node.js, Mongoose and MongoDB you are using?
Node: 10.7.0
Mongoose: 5.5.2 - 5.6.0. Version 5.5.1 provides the expected output
MongoDB: 4.0 & 3.6
The text was updated successfully, but these errors were encountered: