CacheControl / json-rules-engine

A rules engine expressed in JSON
ISC License
2.67k stars 477 forks source link

Checking for empty array on fact #282

Open robross0606 opened 3 years ago

robross0606 commented 3 years ago

Is it possible to check for an array being (not) empty as a fact value? Or, perhaps it would be more flexible to be able to do array length comparisons?

naveen-shetty commented 3 years ago

You can build your own custom operators for that & add it to the engine. Here is are the examples https://github.com/CacheControl/json-rules-engine/blob/master/examples/06-custom-operators.js