Key.create()
Signature
Key.create(data: { role: String, database: String | Null, ttl: Time | Null, data: { *: Any } | Null }) => Key
Description
Creates a key with the provided document fields.
Fauna stores keys as documents in the
Key
system collection.
A key is a type of authentication secret used for anonymous access to a Fauna database. Unlike tokens, keys are not associated with an identity.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
data |
true |
Document fields for the new
For supported document fields, see
|
Return value
Type | Description |
---|---|
The new A key’s secret is shown once — when you create the key. You can’t recover or regenerate a lost key secret. Instead, delete the key and create a new one. |