Document definition

This describes the structure of a Fauna document.

Fields

Field Type Immutable Description

coll

Yes

Collection of which the document is a member. The coll field can’t be indexed.

id

Yes

Main document identifier. It must be unique in the collection. The identifier gets serialized to a string-encoded 64-bit Int.

The id is assigned by Fauna but can be set when the document is created using the document create() method.

The id field can be can be covered by an index value. See index value field.

The id and coll fields together represent a reference, which is a unique document identifier.

ts

Yes

Document last changed timestamp. Updated only on document write. The timestamp is propagated to all child documents.

ttl

Time or null

No

Document time-to-live (TTL), if set.

data

No

User-defined document fields. The data field can’t be created.

Schema method names and schema metadata field names are reserved and can’t be used as a data field name but can be used in nested objects.

Field values can be any supported data type.

See also

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!