-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Filtering with nested include #11036
Comments
Can you please post the outputs of the following lines: console.log(resA.map(a=>a.get({plain:true})));
console.log(resB.map(a=>a.get({plain:true}))); |
Thanks for the response papb! Here is the output.
|
I was able to reproduce. Thank you very much. By the way, replacing |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
What are you doing?
Trying to filter on an associated field.
To Reproduce
Run the code above.
What do you expect to happen?
I'm not entirely sure what the correct way of doing this kind of filtering is. But
I did not expect these 2 queries to produce a different result like this.
What is actually happening?
The first query runs the nested where on a different level from the second query. Seems inconsistent.
The inner where clause is shifted out when I include the useless filtering
where:{id:{[Op.gt]:0}}
Output:
Environment
Dialect:
Dialect library version: 1.6.5
Database version: XXX
Sequelize version: 5.8.7
The text was updated successfully, but these errors were encountered: