Data types
Basic types
Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Boolean |
The boolean data type can only store
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Null |
Null is a special marker used to indicate that a data value does not exist. It is a representation of missing information, indicating a lack of a value. A lack of a value is not the same thing as a value of zero, in the same way that a lack of an answer is not the same thing as an answer of "no". Null is a value that can be directly compared for application programmer
simplicity.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numbers are any real number which are bounded by the double precision
range (64-bit), such as 3, -27, 3.1415. Neither Functions that operate on numbers:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
String |
String data types store any letters, numbers, whitespaces, and/or symbols in a fixed order. FQL accepts and communicates strings as UTF-8 encoded strings. For string functions, any arguments or returned values which utilize offsets and lengths operate using code points. Functions that operate on strings:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Literal |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array |
An Array is a data structure that contains a group of elements. When an Array is used in FQL, it evaluates to its contents.
Functions that operate on arrays:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Object |
The Object type represents a JSON-like object, where its values are a collection of key/value pairs. The keys must be strings and the values must be valid FQL data types. The value expressions are evaluated sequentially in the order that they were specified, left to right. Objects evaluate to their contents:
Functions that operate on objects: |
Special types
In addition to the basic types, FQL supports the following types beyond those native to JSON:
Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Byte |
The Bytes type denotes a Base64-encoded string representing a byte array.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Date |
The Date type denotes a date, with no associated time zone.
Functions that operate on times or dates:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Page |
A
Functions that operate on pages:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Query |
The Query type denotes a query expression object. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ref |
The Ref type denotes a resource reference. Refs may be extracted from
documents, or constructed using the
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set |
The Set type denotes a set identifier. A set is a group of tuples,
typically representing resources or index
Functions that operate on sets:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Timestamp |
The Timestamp type (usually written as A Timestamp can safely store nanosecond precision, but be careful as many operating system clocks provide only microsecond precision. Timestamps may be inserted with offsets, but are converted to UTC; the offset component is lost. A Timestamp must be within the range
Functions that operate on times or dates:
|
Events
Strictly speaking, events aren’t types; they are objects that capture the temporal history of documents by tracking all create, update, and delete operations over a document’s timeline. However, they have a common structure:
Document events
Field | Value | Description |
---|---|---|
|
The reference to the document. |
|
|
Either "create","update" or "delete". |
|
|
An integer value representing a UNIX timestamp, with microsecond resolution, at which the event occurred. |
|
|
Varies based on the action. |
Set events
Set events are represented by an object returned when paginating through an index.
Field | Value | Description |
---|---|---|
|
The reference to the document. |
|
|
Either |
|
|
An integer value representing a UNIX timestamp, with microsecond resolution, at which the event occurred. |
|
|
Exactly as defined by the index’s |
Precedence
Types have an order of precedence. When comparing values of different types, they are ranked in the following order, from greatest to least. For example, a double is sorted before an integer because of its type.
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
documentation@fauna.com
Thank you for your feedback!