Answer the question
In order to leave comments, you need to log in
How to make a common where for the records of the requested table and the records of the included include table?
I am using sequelize ORM. I make a query to the table of orders, include goods in it, how can I do this: "WHERE orders.number = 1 OR goods.vencode = 1; ?
I know how to use $or, but where related to the goods is written in include, and where for orders after include, but how to write a general where?
Answer the question
In order to leave comments, you need to log in
Handled the situation
$or:[
'$goods.vencode$': {
$like: '%searchstring%'
},
number: {
$like: '%searchstring%'
}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question