-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use $pull
on nested array within discriminated union
#14675
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Comments
vkarpov15
added
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
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
Jun 19, 2024
vkarpov15
added a commit
that referenced
this issue
Jun 19, 2024
…iminator key is set in filter Fix #14675
vkarpov15
added a commit
that referenced
this issue
Jun 21, 2024
fix(query): cast $pull using embedded discriminator schema when discriminator key is set in filter
This was referenced Jul 16, 2024
Closed
This was referenced Jul 17, 2024
This was referenced Jul 17, 2024
This was referenced Aug 21, 2024
This was referenced Aug 23, 2024
This was referenced Aug 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.4.3
Node.js version
20.10.0
MongoDB server version
6.0.14
Typescript version (if applicable)
5.4.5
Description
It is not possible to perform a
$pull
on a nested discriminator field usingModel.findOneAndUpdate()
Steps to Reproduce
I have created an MRE repo at rpmccarter/mongoose-discriminator-pull-bug-repro that demonstrates the bug. Here is some of the relevant code, taken from index.ts:
Expected Behavior
$pull
should work on nested array fields when the discriminator is specified.The text was updated successfully, but these errors were encountered: