Skip to main content

Type System

ReQL language comes with a basic type system and this section list the supported types.

As a user of the ReQL language, the only time you will need to explicitly provide type annotation is saving the result of jsonExtract (see jsonExtract for more details).

Primitive Types

String

Arbitrary length UTF-8 string. String literals is defined by double quote symbol.

ex. "hello world", "世界好"

Number

Integer and floats.

ex. 10, 1.2

Duration

Duration of time, units supported include day, hr, min , s (second), ms (millisecond)

ex. 1hr, 200ms

Boolean

True or false

ex. true, fale

Null

Represent the absence of value; this is also the value that functions will return when there is a runtime error

ex. null

Jval (JSON Value)

A type representing a JSON object inside ReQL.

# Built in variable `EventData` is of type `JVal`
ex. EventData

Container Types

Array

A list of items

ex. `[1, 2, 3]`, `["a", 1, "b"]`

Map

Map is the type name for a key value structure, equivalent to an object in javascript or dictionary in python.

ex. `{"a": 1, "b": 2}`