SurrealDB extends the CBOR protocol with a number of custom tags to support the full range of data types available in SurrealDB. This document provides an overview of the custom tags and their respective values.
References:
Custom tags
Tag 0
A datetime represented in an RFC 3339 string.
Adopted from the Iana Specification.
Note: Tag 12 is preferred and always sent back by SurrealDB.
Tag 6
Represents a NONE value. The value passed to the tagged value is null, as it cannot be empty.
Tag 7
A table name, represented as a string.
Tag 8
A Record ID, represented as a two-value array, containing a table part (string) and an id part (string, number, object or array).
Instead of a two-value array, SurrealDB also accepts a string with a string-formatted Record ID. A string Record ID will never be sent back from SurrealDB, however.
Tag 9
A UUID represented in a string format.
Note: Tag 37 is preferred and always sent back by SurrealDB.
Tag 10
A Decimal represented in a string format.
Tag 12
A Datetime represented in a two-value array, containing seconds (number) and optionally nanoseconds (number).
Tag 13
A Duration represented in a string format.
Note: Tag 14 is preferred and always sent back by SurrealDB.
Tag 14
A Duration represented in a two-value array, containing optionally seconds (number) and optionally nanoseconds (number). An empty array will be considered a duration of 0.
Tag 15
A Future represented as a string containing the uncomputed SurrealQL query or expression. The value must be sent as an Object wrapped in {}, which is also the format SurrealDB returns it in. This allows it to be computed when it is accessed or used within a query.
Tag 37
A UUID represented in a binary format. Please reference (https://docs.rs/uuid/latest/uuid/struct.Uuid.html#method.as_bytes).
Adopted from the Iana Specification.
Tag 49
A Range represented as a two-value array containing optional bounds. Each bound can be either null (for unbounded), or a tagged value using either Tag 50 (included bound) or Tag 51 (excluded bound).
The bounds follow SurrealQL's range syntax where .. represents a range, >.. represents an excluded lower bound, and ..= represents an included upper bound.
Tag 50
An included bound value used within Range bounds. The tagged value represents an inclusive boundary (equivalent to ..= for upper bounds in SurrealQL range syntax).
Tag 51
An excluded bound value used within Range bounds. The tagged value represents an exclusive boundary (equivalent to >.. for lower bounds in SurrealQL range syntax).
Tag 88
A Geometry Point represented by a two-value array containing a longitude (float) and latitude (float).
Tag 89
A Geometry Line represented by an array with two or more points (Tag 88).
Tag 90
A Geometry Polygon represented by an array with one or more closed lines (Tag 89).
If a line is not closed, meaning that its first and last points are not equal, SurrealDB automatically appends the line's first point to its end.
Tag 91
A Geometry MultiPoint represented by an array with one or more points (Tag 88).
Tag 92
A Geometry MultiLine represented by an array with one or more lines (Tag 89).
Tag 93
A Geometry MultiPolygon represented by an array with one or more polygons (Tag 90).
Tag 94
A Geometry Collection represented by an array with one or more geometry values (Tag 88, Tag 89, Tag 90, Tag 91, Tag 92, Tag 93 or Tag 94).