Loopbackjs 如何过滤环回4中类型为数组的结果?
我想得到成员值为1的记录,所以我应用了这样一个过滤器- http://localhost:3000/miscs?filter[其中][inq][成员]=1 但这不起作用。如果无法执行这样的查询,那么我是否可以对模型进行一些更改,以调整其类型,使其能够接受CSV值并过滤这些数据Loopbackjs 如何过滤环回4中类型为数组的结果?,loopbackjs,loopback4,Loopbackjs,Loopback4,我想得到成员值为1的记录,所以我应用了这样一个过滤器- http://localhost:3000/miscs?filter[其中][inq][成员]=1 但这不起作用。如果无法执行这样的查询,那么我是否可以对模型进行一些更改,以调整其类型,使其能够接受CSV值并过滤这些数据 请帮忙。提前谢谢 对于Postgresql连接器,使用包含,它接受一个数组: [ { "id":1, "members":[ 1,
请帮忙。提前谢谢 对于Postgresql连接器,使用
包含,它接受一个数组:
[
{
"id":1,
"members":[
1,
2,
3
]
},
{
"id":2,
"members":[
1,
2,
3,
4,
5
]
},
{
"id":3,
"members":[
10,
20,
30,
40,
50
]
},
{
"id":4,
"members":[
100,
200,
300,
400,
500
]
},
{
"id":5,
"members":[
1,
2,
3,
500,
1000,
5000
]
}
]
谢谢你的回复,但这并没有达到预期效果!是否有任何方法可以将成员字段修改为其他类型并应用筛选器?我认为如果使用mongodb,这种事情是可能的。
[
{
"id":1,
"members":[
1,
2,
3
]
},
{
"id":2,
"members":[
1,
2,
3,
4,
5
]
},
{
"id":3,
"members":[
10,
20,
30,
40,
50
]
},
{
"id":4,
"members":[
100,
200,
300,
400,
500
]
},
{
"id":5,
"members":[
1,
2,
3,
500,
1000,
5000
]
}
]
?filter[where][contains][members][0]=1
- SAME AS -
{
where: {
contains: [1]
}
}