I have a feedback model:
{
"name": "Feedback",
"plural": "Feedback",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"text": {
"type": "string",
"required": true
},
},
"validations": [],
"relations": {
"tags": {
"type": "hasAndBelongsToMany",
"model": "Tag",
"foreignKey": ""
}
},
"acls": [],
"methods": {}
}
That has a hasAndBelongsToMany relationship with tags:
{
"name": "Tag",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
I want to return only feedback models that have certain tag children, the following query just returns all the Feedback models and it is not filtered.
Can somebody point out what I am doing wrong?
const result = yield Feedback.find({
include: {
relation: "tags",
scope: {
where: {
name: { inq: ['BETA_FEEDBACK']}
}
}
}
})