# Expression Reference

## Conjunction

 and Returns `true` if all elements are `true`, `else` if otherwise. Signatures: `[ && […​]]` ⇒ `` `[ and […​]]` ⇒ `` `and([, , …​]])` ⇒ `` Expression examples: `bool_field && true` `(field == 'value') && bool_field` `bool_field and true` `(field == 'value') and bool_field` Function examples: `and(bool_field, true)` `and((field == 'value'), bool_field)` or Returns `true` if any element is `true`, `else` if otherwise. Signatures: `[ || […​]]` ⇒ `` `[ or […​]]` ⇒ `` `or([, , …​]])` ⇒ `` Expression examples: `bool_field || true` `(field == 'value') || bool_field` `bool_field or true` `(field == 'value') or bool_field` Function examples: `or(bool_field, true)` `or((field == 'value'), bool_field)`

## Comparison

 equals Returns `true` if types are comparable and the values match. Signatures: ` = ` ⇒ `` ` == ` ⇒ `` ` === ` ⇒ `` `eq(, )` ⇒ `` Expression examples: `field == 'value'` `number == 10` `year(dateField) == year(now())` Function examples: `eq(field, 'value')` `eq(number, 10)` `eq(year(dateField), year(now()))`
 not equals Returns `true` if types are not comparable or the values don’t match. Signatures: ` != ` ⇒ `` ` !== ` ⇒ `` `ne(, )` ⇒ `` Expression examples: `field != 'value'` `number != 10` `year(dateField) != year(now())` Function examples: `ne(field, 'value')` `ne(number, 10)` `ne(year(dateField), year(now()))`
 less than Returns `true` if the left value is less than the right value. Signatures: ` < ` ⇒ `` `lt(, )` ⇒ `` Expression examples: `field < 'value'` `number < 10` `year(dateField) < year(now())` Function examples: `lt(field, 'value')` `lt(number, 10)` `lt(year(dateField), year(now()))`
 less than or equal to Returns `true` if left value is less than or equal to the right value. Signatures: `` ⇒ `` `le(, )` ⇒ `` Expression examples: `field ⇐ 'value'` `number ⇐ 10` `year(dateField) ⇐ year(now())` Function examples: `le(field, 'value')` `le(number, 10)` `le(year(dateField), year(now()))`
 greater than Returns `true` if left value is greater than the right value. Signatures: ` > ` ⇒ `` `gt(, )` ⇒ `` Expression examples: `field > 'value'` `number > 10` `year(dateField) > year(now())` Function examples: `gt(field, 'value')` `gt(number, 10)` `gt(year(dateField), year(now()))`
 greater or equal than Returns `true` if left value is greater than or equal to the right value. Signatures: ` >= ` ⇒ `` `ge(, )` ⇒ `` Expression examples: `field >= 'value'` `number >= 10` `year(dateField) >= year(now())` Function examples: `ge(field, 'value')` `ge(number, 10)` `ge(year(dateField), year(now()))`

## String Comparison

 like Returns `true` if the left value matches the pattern on the right. Signatures: ` like ` ⇒ `` `like(, )` ⇒ `` Expression examples: `field like 'value'` `field like 'va_ue'` `name like 'test%'` Function examples: `like(field, 'value')` `like(field, 'va_ue')` `like(name, 'test%')`
 not like Returns `true` if the left value does not match the pattern on the right. Signatures: ` not like ` ⇒ `` `nlike(, )` ⇒ `` Expression examples: `field not like 'value'` `field not like 'va_ue'` `name not like 'test%'` Function examples: `nlike(field, 'value')` `nlike(field, 'va_ue')` `nlike(name, 'test%')`

## String Operation

 concat .Signatures: * `concat([, , …​]])` ⇒ `` .Function examples: * `concat('a', 'b')` * `concat(field, 'b')`

## Arithmetic

 add Adds the two numbers. Signatures: ` + ` ⇒ `` `add(, )` ⇒ `` Expression examples: `100 + 20` `number + 10` `year(dateField) + year(now())` Function examples: `add(100, 20)` `add(number, 10)` `add(year(dateField), year(now()))`
 sub Subtracts the two numbers. Signatures: ` - ` ⇒ `` `sub(, )` ⇒ `` Expression examples: `100 - 20` `number - 10` `year(dateField) - year(now())` Function examples: `sub(100, 20)` `sub(number, 10)` `sub(year(dateField), year(now()))`
 mult Multiplies the two numbers. Signatures: ` * ` ⇒ `` `mult(, )` ⇒ `` Expression examples: `100 * 20` `number * 10` `year(dateField) * year(now())` Function examples: `mult(100, 20)` `mult(number, 10)` `mult(year(dateField), year(now()))`
 div Divides the two numbers amongst each other. Signatures: ` / ` ⇒ `` `div(, )` ⇒ `` Expression examples: `100 / 20` `number / 10` `year(dateField) / year(now())` Function examples: `div(100, 20)` `div(number, 10)` `div(year(dateField), year(now()))`

## Aggregation

 count Returns the number of items. Signatures: `count()` ⇒ `` Expression examples: `count()` Function examples: `count()`
 sum Returns the sum of the items. Signatures: `sum()` ⇒ `` Expression examples: `field + current_column` Function examples: `sum(field)`
 max Returns the maximum of two values. Signatures: `max()` ⇒ `` Expression examples: `max(field)` Function examples: `max(field)`
 min Returns the minimum of two values. Signatures: `min()` ⇒ `` Expression examples: `min(field)` Function examples: `min(field)`
 avg Returns the average of two values. Signatures: `avg()` ⇒ `` Expression examples: `avg(field)` Function examples: `avg(field)`

## Date Manipulation

 now Returns the current timestamp. Signatures: `now()` ⇒ `` Expression examples: `now()`
 quarter Returns the quarter of the timestamp. Signatures: `quarter()` ⇒ `` Expression examples: `quarter(date_field)` `quarter(now())` `quarter(date('2021-01-01T01:00:00Z'))`
 year Returns the year of the timestamp. Signatures: `year()` ⇒ `` Expression examples: `year(date_field)` `year(now())` `year(date('2021-01-01T01:00:00Z'))`
 month Returns the month of the timestamp. Signatures: `month()` ⇒ `` Expression examples: `month(date_field)` `month(now())` `month(date('2021-01-01T01:00:00Z'))`

## Typecast

 float Casts the value to a float. Signatures: `float()` ⇒ `` Expression examples: `float(some_field)` `float('10.9')` `avg(cost) > float(10.9)`

string

Casts the value to a string.

 The string length for PostgreSQL and MySQL is limited to `8192` characters.
• `string(<Any>)``<String>`

• `string(some_field)`

• `string('10.9')`

 int Casts the value to an integer. Signatures: `int()` ⇒ `` Expression examples: `int(some_field)` `int('10.9')` `avg(cost) > int(10.9)`
 date Casts the value to a timestamp. Signatures: `date()` ⇒ `` Expression examples: `date(some_field)` `date('2021-01-01T01:00:00Z')`