Passing undefined to mongoose's Model.create with vs without a callback #9765
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
What is the current behavior?
I'm getting a different behavior when passing
undefined
to a mongoose's model'screate
when using vs. not using a callback.steps to reproduce
An example:
In the first case, no
User
record is created in the database, andcreatedUser
isundefined
.In the second case, a
User
record is created in the database, andcreatedUser
is assigned.Note that I'm aware of the following:
What is the expected behavior?
Both cases should create a record in the database and return the created record.
What are the versions of Node.js, Mongoose and MongoDB you are using?
Node.js: 12.16.1
MongoDB: 4.4.2
Mongoose: 5.11.9
The text was updated successfully, but these errors were encountered: