CacheControl / CacheControl/json-rules-engine

How to handle array of objects?

Abierto
#421 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
3.1k
Forks
507
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.