You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stack trace of where this issue appears to be happening:
at ObjectId.SchemaType.applySetters (/.../mongoose/lib/schematype.js:1122:12)
at SchemaArray.cast (/.../mongoose/lib/schema/array.js:385:32)
at SchemaArray.SchemaType.applySetters (/.../mongoose/lib/schematype.js:1122:12)
at model.$set (/.../mongoose/lib/document.js:1386:20)
at model.$set (/.../mongoose/lib/document.js:1128:16)
at model.Document (/.../mongoose/lib/document.js:148:12)
at model.Model (/.../mongoose/lib/model.js:106:12)
What is the expected behavior?
Mongoose to not mutate inputs to the Model constructor.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: v14.15.1
Mongoose: v6.0.6
MongoDB: v4.1.1
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Instantiating models mutates the input arguments. We ran into it with object ID arrays but there may be more cases.
The code below prints:
Assertion failed: after
If the current behavior is a bug, please provide the steps to reproduce.
Stack trace of where this issue appears to be happening:
What is the expected behavior?
Mongoose to not mutate inputs to the Model constructor.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: v14.15.1
Mongoose: v6.0.6
MongoDB: v4.1.1
The text was updated successfully, but these errors were encountered: