Document fields
This describes the structure of a Fauna document.
Fields
Field | Type | Immutable | Description |
---|---|---|---|
|
Yes |
Collection of which the document is a member. |
|
|
Yes |
||
|
Yes |
Document last changed timestamp. Updated only on document write. The timestamp is propagated to all child documents. |
|
|
Time or |
No |
Document time-to-live (TTL), if set. |
|
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.
Reference usage
The id
and coll
fields together represent a reference, which is a
unique document identifier.
-
The
coll
field can’t be indexed. -
The
id
field can be can be covered by an index value. See index value field. -
When a document is nested in another document, only the
id
andcoll
fields of the nested document are stored, as shown in this example:{ id: "345963092586267136", coll: MagicalCreature, ts: Time("2022-10-24T06:59:16.180Z"), name: "Hen Wen", owner: { id: "345963092567392768", coll: Character } }
When a nested document field is selected, using projection or dot notation, the full document is available, as shown in these examples:
{ owner: { id: "345963092567392768", coll: Character, ts: Time("2022-10-19T15:56:05.910Z"), name: "Taran", screen_name: "taran86" } }
{ ownerName: "Taran" }
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!