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
Can't use array of sequelize.where() on having or where properties of the options object #10142
Comments
I was going to report the same problem but your trick on clause Thanks a lot! |
Your trick on clause having saved my day. Thanks |
Save my day too :D |
You have posted a code snippet that shows the problem but is not entirely self-contained (i.e. I can't just copy-paste it and run it). Can you (or someone else) please provide a SSCCE (also known as MCVE/reprex)? This will help tackling the issue faster. |
Hey @papb sorry about that. Do you have any recomendation on how to that properly ? I can only think of mocking the database, if that is what you have in mind. I can do it. |
@lucastaliberti I just want a code that I can copy-paste and run and see the problem. If I try to run the code in your first post, I will obviously get a In short: just put yourself in my shoes trying to reproduce your problem with the least effort as possible 😬 imagine what I will do: create an empty folder, install sequelize, and run your code... Shouldn't take too long 👍 |
Hey, @papb sorry for the delay. |
Has this issue been resolved? |
@papb did you have the chance to check my example? I believe we could remove the awaiting response tag by now. |
What are you doing?
I'm trying to build a query with multiple
having
filters, like the code belowThis code will throw
[ERROR] : Support for literal replacements in the
whereobject has been removed.
but if I add an empty object to the having property it works perfectly, which seems weird to me.
This is probably caused by the fact the
Utils.canTreatArrayAsAnd(value)
returnsfalse
to arrays that don't contain any plain object, which I'm afraid is not correct since the functionality works if I "cheat" the canTreatArrayAsAnd check.What do you expect to happen?
Query works and having clause is properly built when passing an array of
sequelize.where
objects to the having or where properties of the options object.What is actually happening?
get
[ERROR] : Support for literal replacements in the
whereobject has been removed.
Dialect: postgres / any(?)
Database version: postgres 9.6
__Sequelize version: 4.4
__Tested with latest release: No
The text was updated successfully, but these errors were encountered: