Home /  Mappings /  JSONata Operators / 

Numeric Operators

+ (Addition)

The addition operator adds the operands to produce the numerical sum. It is an error if either operand is not a number.

Example

- (Substraction/Negation)

The subtraction operator subtracts the RHS value from the LHS value to produce the numerical difference It is an error if either operand is not a number.

It can also be used in its unary form to negate a number

Example

* (Multiplication)

The multiplication operator multiplies the operands to produce the numerical product. It is an error if either operand is not a number.

Example

/ (Division)

The division operator divides the RHS into the LHS to produce the numerical quotient. It is an error if either operand is not a number.

Example

% (Modulo)

The modulo operator divides the RHS into the LHS using whole number division to produce a whole number quotient and a remainder. This operator returns the remainder. It is an error if either operand is not a number.

Example

.. (Range)

The sequence generation operator is used to create an array of monotonically increasing integer start with the number on the LHS and ending with the number on the RHS. It is an error if either operand does not evaluate to an integer. The sequence generator can only be used within an array constructor [].

Example

+ (Addition)- (Substraction/Negation)* (Multiplication)/ (Division)% (Modulo).. (Range)