Model.create fails with Cannot read property 'length' of undefined
if there is a second argument with value null or undefined.
#13487
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Prerequisites
Mongoose version
7.2.2
Node.js version
14.20.1
MongoDB server version
5.0.7
Typescript version (if applicable)
No response
Description
The function throws the following error when executing
Model.create
with a second argument having valuenull
orundefined
,It works fine on version
6.x
.Steps to Reproduce
Expected Behavior
The entry should get created. The options parameter should be ignored since it's
undefined
.be ignoredThe text was updated successfully, but these errors were encountered: