CacheControl / CacheControl/json-rules-engine

How to handle array of objects?

未关闭
#421 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
3.1k
派生
507
PR 合并指标
30 天内没有已合并 PR

描述

Usecase: Is there any equipment with type embroidery and setting speed 250?

Fact:
```
const facts = {
equipmentList: [
{ type: 'embroidery', setting: { speed: 250 } },
{ type: 'sewing', setting: { speed: 150 } },
],
substrate: { color: { hexcode: '#FFFFFF' } },
Size: 'S',
};
```

// the following IS NOT working as expected. no matter what 'setting.speed' I give, I am getting true for the condition
```
{
"all": [
{
"fact": "equipmentList",
"path": "$[?(@.type == 'sewing' && @.setting.speed == 250)]",
"operator": "notEqual",
"value": []
},
]
}
```

Does the package support this kind of a usecase?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。