json-rules-engine icon indicating copy to clipboard operation
json-rules-engine copied to clipboard

Checking for empty array on fact

Open robross0606 opened this issue 4 years ago • 1 comments

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?

robross0606 avatar Oct 08 '21 19:10 robross0606

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

naveen-shetty avatar Oct 08 '21 21:10 naveen-shetty