dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 376 forks source link

Custom conditions in join query #560

Open felipenervo opened 10 years ago

felipenervo commented 10 years ago

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.

ronald2wing commented 7 years ago

It is still not possible.