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);
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.