Available Operators
Rule Engine JS includes 20+ built-in operators organized into 7 categories:Comparison
6 operators
eq, neq, gt, gte, lt, lteLogical
3 operators
and, or, notString
4 operators
contains, startsWith, endsWith, regexArray
2 operators
in, notInNumeric
1 operator
betweenSpecial
2 operators
isNull, isNotNullState
6 operators
changed, changedBy, changedFrom, changedTo, increased, decreasedQuick Reference
Comparison Operators
Comparison Operators
Logical Operators
Logical Operators
String Operators
String Operators
Array Operators
Array Operators
Numeric Operators
Numeric Operators
Special Operators
Special Operators
State Change Operators (Stateful Engine Only)
State Change Operators (Stateful Engine Only)
Operator Syntax
All operators follow a consistent syntax pattern:Single-Argument Operators
Two-Argument Operators
Multi-Argument Operators
Using Rule Helpers
The Rule Helpers API provides a more readable way to build rules:- Direct JSON
- Rule Helpers
Type Coercion
By default, operators perform type coercion for flexibility:Operator Composition
Operators can be nested and combined for complex logic:Custom Operators
Extend the engine with custom business logic:Performance Considerations
Operator Order
Place faster operators first in
and conditions to fail earlyAvoid Deep Nesting
Deeply nested rules are harder to cache and slower to evaluate
Cache-Friendly Paths
Use consistent path names to maximize cache hits
Batch Similar Rules
Group related rules for better cache utilization
Next Steps
Comparison
Detailed comparison operators
Logical
Detailed logical operators
String
Detailed string operators
Array
Detailed array operators
State
Detailed state operators
Custom Operators
Create custom operators
