Hi,
I have the following relation:
"relations": {
"categories": {
"type": "hasMany",
"model": "Category",
"foreignKey": "recipeId",
"through": "RecipeCategory"
}
}
As you can see, this is a hasManyThrough relation, between Recipe and Category.
I want to build a search in Angular which should search in recipe name and selected categories, so I've reached this point:
Recipe.find({
filter: {
where: {
name: {
like: 'test'
}
}
include: [ 'categories']
}
}, function(recipes) {
console.log(recipes);
}, function(err) {
console.log(err);
});
}
but I don't know how to add the filter for categories ( AND categories selected_categories).
Can anyone help me please?
Thank you!