JSONA通过查看父元素来设置筛选器值

JSONA通过查看父元素来设置筛选器值,json,jsonata,Json,Jsonata,我有一个JSON blob,格式如下: { "allEntries": [ { "property": { "type": "ab" }, "values": { "score": 10.40 } }, { "property": { "type": "ty" }, "values": { "sc

我有一个JSON blob,格式如下:

{
  "allEntries": [
     {
        "property": {
           "type": "ab"
        }, "values": {
           "score": 10.40
        }
     },
     {
        "property": {
           "type": "ty"
        }, "values": {
           "score": 90.45
        }
     }

  ]
}
我只想检查属性类型
ab
的分数是否小于10。但是,
$min(allEntries.values.score)
会遍历所有属性,不会筛选出我不感兴趣的类型。
我尝试使用父属性“%”,但这也不起作用(
表示“父”的对象无法从此表达式派生)

您尚未说明所需的输出是什么,但可以使用以下表达式筛选数组项列表:

allEntries[property.type='ab' and values.score < 10]
allEntries[property.type='ab'和values.score<10]

请参见

您尚未说明所需的输出是什么,但可以使用以下表达式筛选数组项列表:

allEntries[property.type='ab' and values.score < 10]
allEntries[property.type='ab'和values.score<10]

如果参考类型=随机或参考类型=随机,参考类型=随机,如果最小分数小于5,请参见中的“我想返回真”如何。我想忽略Reference Type=randomAb
您可以使用正则表达式来匹配属性名,并基于它筛选属性:```$sift(字段,函数($v,$k){$k~>/Reference(map={Type=random(Ac)})/和$number($v.labels.score)<5})```如果
Reference type=random或Reference type=randomAc的最小分数小于5,那么我想返回true。我想忽略Reference Type=randomAb
您可以使用正则表达式来匹配属性名,并基于它筛选属性:```$sift(字段,函数($v,$k){$k~>/Reference(map={Type=random(Ac)})/和$number($v.labels.score)<5})```