I am trying to join table ABC
with XYZ
, and to filter data of included table 'xyz' using Strongloop.
My code is:
return ABC.find({filter:{
where: {abcPropertyName: {neq: '1234'}},
include: {**XYZ**: *[{xyzPropertyName: 'somevalue'}]*}}}).$promise
My data-source is:
____abc.json____
"relations": {
"xyz": {
"type": "hasOne",
"model": "xyz",
"foreignKey": "abcId"
}
____xyz.json____
"relations": {
"abc": {
"type": "blongsTo",
"model": "abc",
"foreignKey": "abcId"
}
Issue: filter in 'xyz' is not working. Please help. thanks in advance
Try to use the following include filter:
include: {
relation: **XYZ**,
scope: {
where: {xyzPropertyName: 'somevalue'}
}
}