regression: 5.4.11 rejects subdocument required:false if type is not explicitly Object #7516
Labels
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
Milestone
Do you want to request a feature or report a bug?
bug
What is the current behavior?
in 5.4.10 and below, this is accepted:
If the current behavior is a bug, please provide the steps to reproduce.
In 5.4.11, the above schema produces the error:
(stack:TypeError: Invalid value for schema path `subdoc.required` ...
Unless the subdocument type is explicitly set to
Object
:What is the expected behavior?
5.4.11 should continue to accept schemas which were accepted under 5.4.10
Please mention your node.js, mongoose and MongoDB version.
tested with node v10.15.0 amongst other v10 versions.
The text was updated successfully, but these errors were encountered: