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
Do you want to request a feature or report a bug?
bug
What is the current behavior?
We have a schema with “Recursive embedded discriminators in arrays” (implemented following these instructions).
When parsing a given, nested object structure, Mongoose 5.10.3+ (up until 5.10.18) loses parts of the object tree. Mongoose 5.10.2 and below work fine.
If the current behavior is a bug, please provide the steps to reproduce.
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Dec 2, 2020
Looks like this was an unintended consequence of #9370. We'll fix this for v5.11.3.
However, your example doesn't quite line up exactly with the one in the discriminator docs. Our tests are passing for that example, the difference is that you're relying on adding the same document array schema type childrenArraySchema to itself via a discriminator. The example in the docs instead relies on adding a schema (not a schema type) subEventSchema to itself.
I'm not quite sure how to get your example to line up with how the docs does it - recursion is confusing. But your approach should work going forward.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
We have a schema with “Recursive embedded discriminators in arrays” (implemented following these instructions).
When parsing a given, nested object structure, Mongoose 5.10.3+ (up until 5.10.18) loses parts of the object tree. Mongoose 5.10.2 and below work fine.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Test should pass.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: