我需要在loopback中过滤一个字符串数组 . 我有以下型号 .
{ ... "type": ["string"], ... }
我正在使用的过滤器是 {"where":{"type":["filter string"]}} 和 {"type":["filter string"]} ,但两者都不起作用并返回所有条目 .
{"where":{"type":["filter string"]}}
{"type":["filter string"]}
请帮忙 . 提前致谢 .
请使用没有方括号的 {"where":{"type":"filter string"}} . 由于 type 被定义为字符串数组,因此该查询将返回带有 filter string 的条目作为任何索引处的元素 .
{"where":{"type":"filter string"}}
type
filter string
1 回答
请使用没有方括号的
{"where":{"type":"filter string"}}
. 由于type
被定义为字符串数组,因此该查询将返回带有filter string
的条目作为任何索引处的元素 .