Token document definition

The Token collection is a native collection, and its documents have an immutable, Fauna-defined structure. Moreover, the document structure returned at creation differs from the token document structure returned by a query of Token documents.

At creation, Fauna returns the full document associated with the token and a secret field. Subsequent queries of the token return only the document collection and identifier.

Field name Value type Description

id

A unique identifier for a token. Fauna assigns this value at creation.

coll

Token

ts

Creation timestamp, with microsecond resolution and time zone.

document

ref

The identity document associated with this token. At creation, all document fields are returned. Subsequent queries for the token return only these two fields:

id

Document identifier associated with this credential.

coll

Name of Collection that stores this document.

secret

The secret is a randomly generated cryptographic hash.

At creation is the only time Fauna displays the secret field. The value in this field is equivalent to a password. Fauna cannot recover a secret that is discarded or lost. Copy and save the secret to a password manager or other safe location. Delete and replace keys or tokens for which you have lost the secret. If you no longer need a key or token, you should delete it.

ttl

Timestamp indicating a document lifespan. When the ttl is reached, Fauna removes it. If ttl isn’t provided, this value is null, and the document persists indefinitely.

data

(Optional) User-defined metadata for the token.

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!