如何在包含“模式”使用strongloop
问题描述:
我试图连接表ABC
与XYZ
过滤数据,并过滤使用Strongloop列入表“XYZ”的数据。如何在包含“模式”使用strongloop
我的代码是:
return ABC.find({filter:{
where: {abcPropertyName: {neq: '1234'}},
include: {**XYZ**: *[{xyzPropertyName: 'somevalue'}]*}}}).$promise
我的数据源是:
____ abc.json ____
"relations": {
"xyz": {
"type": "hasOne",
"model": "xyz",
"foreignKey": "abcId"
}
____ xyz.json ____
"relations": {
"abc": {
"type": "blongsTo",
"model": "abc",
"foreignKey": "abcId"
}
Issue:'xyz'中的过滤器不起作用。请帮忙。在此先感谢
答
尝试使用下面的包含过滤器:
include: {
relation: **XYZ**,
scope: {
where: {xyzPropertyName: 'somevalue'}
}
}
由于其工作。 – NG51214