Key document definition

The Key collection is a system collection. Its documents have an immutable, Fauna-defined structure. Moreover, the document structure returned at creation differs from the key document structure returned by a query of Key documents.

At creation, Fauna returns the key and a secret field. Subsequent queries of the key don’t return the secret. Fauna Fauna can’t recover a secret that is discarded or lost. So, secure secrets with the same care and attention as any password.


Field name Value type Description


A unique identifier assigned by Fauna when the key is created.


Collection name.


Creation timestamp, with microsecond resolution and time zone.


A user-defined name.


Name of a user-defined role or one of the built-in roles:

  • admin

  • server

  • server-readonly


The secret is a randomly generated cryptographic hash. This field isn’t stored in the document. The secret is only accessible in the Key.create() return. A caller obtains the secret from this return and stores it for subsequent queries. Fauna can’t recover a discarded or lost secret.


Timestamp that defines the key expiration time. When the ttl time expires, the key is deleted.
Default = null. The key persists indefinitely.



Reference for the database associated with this key.


User-defined metadata for the key.

See also

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email

Thank you for your feedback!