Mongodb 阵列中的Restheart |过滤器
如果存在数据子集(数组中的数据),如何使用Restheart筛选文档 这是一个JSON示例Mongodb 阵列中的Restheart |过滤器,mongodb,rest,restheart,Mongodb,Rest,Restheart,如果存在数据子集(数组中的数据),如何使用Restheart筛选文档 这是一个JSON示例 { "_id" : ObjectId("58760e53a4c0a73900472eb0"), "foods" : [ "root vegetables", "yogurt", "other vegetables" ], "prices" : [ "$1", "$23",
{
"_id" : ObjectId("58760e53a4c0a73900472eb0"),
"foods" : [
"root vegetables",
"yogurt",
"other vegetables"
],
"prices" : [
"$1",
"$23",
"$21",
],
"market_ratio" : 0.606299212598425
}
例如,我想获取所有包含“酸奶”的食品文档
我尝试了?filter={'foods':['酸奶]}和sort\u by=+market\u ratio“
,但它没有返回任何内容。正确的方法:
?filter={'foods':{$in:"[yogurt, curd]"}}
试试?filter=“{'foods':'酸奶'}”和sort_by=+market_ratio