重新心 |在数组中过滤

Restheart | filter within an array

如果有子数据集(数组中的数据),我如何使用 Restheart 过滤文档

这是一个示例JSON

{
    "_id" : ObjectId("58760e53a4c0a73900472eb0"),
    "foods" : [ 
        "root vegetables", 
        "yogurt", 
        "other vegetables"
    ],
    "prices" : [ 
        "",
        "",
        "",
    ],
    "market_ratio" : 0.606299212598425
}

例如,我想获取所有带有 foods 的文档,其中包括 ```yogurt

我尝试了 ?filter={'foods':['yogurt']}&sort_by=+market_ratio" 但它 return 没有任何效果。

正确的做法:

?filter={'foods':{$in:"[yogurt, curd]"}}