node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

Custom conditions in join query

Open felipenervo opened this issue 11 years ago • 1 comments

I want execute query like that:

SELECT product.*, departament.name, category.name from product INNER JOIN departament ON product.departament_id = departament.departament_id INNER JOIN category ON product.category_id = category.category_id

WHERE product.name LIKE '%test%' or departament.name LIKE '%test2%' or category .name LIKE '%test3%'

Code example: product.find({ or : [ { product : { name : orm.like("test") } }, { departament : { name : orm.like("test") } }, { category : { name : orm.like("test") } } ]}, { autoFetch : true }, cb);

OR

product.find({ product : { name : orm.like("test") }, departament : { name : orm.like("test") } }, { autoFetch : true }, cb);

Please, say it is possible.

felipenervo avatar Oct 02 '14 23:10 felipenervo

It is still not possible.

ronald2wing avatar Dec 16 '16 16:12 ronald2wing