在 StrongLoop 中包含的过滤器中写入过滤条件
Write filter condition inside filter include in StrongLoop
我在 Node 中写了这个过滤器:
include: {
relation: 'province',
scope: {
where: {
'regionId': 9
}
}}
过滤器正常工作,我写的其余api过滤器是这样的:
filter[include][province][scope][where][regionId]=9
我有这个错误:
"error": {
"name": "Error",
"status": 500,
"message": "Relation \"scope\" is not defined for Provinces model"
您可以像在节点中调用一样使用 json 过滤器,这不像 REST
?filter={"include": {"relation": "province","scope": {"where": {"regionId": 9}}}}
我在 Node 中写了这个过滤器:
include: {
relation: 'province',
scope: {
where: {
'regionId': 9
}
}}
过滤器正常工作,我写的其余api过滤器是这样的:
filter[include][province][scope][where][regionId]=9
我有这个错误:
"error": { "name": "Error", "status": 500, "message": "Relation \"scope\" is not defined for Provinces model"
您可以像在节点中调用一样使用 json 过滤器,这不像 REST
?filter={"include": {"relation": "province","scope": {"where": {"regionId": 9}}}}