Check out v4 of the Fauna CLI
v4 of the Fauna CLI is now in beta. The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start. |
Key.byId()
Learn: Keys |
---|
Get a key by its
document id
.
Description
Gets a key, represented as an
Key
document, by its
document id
.
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 |
---|---|---|---|
id |
true |
ID of the
|
Return value
Type | Description |
---|---|
Resolved reference to the |
Examples
Key.byId("412655134325080576")
{
id: "412655134325080576",
coll: Key,
ts: Time("2099-08-01T02:45:50.490Z"),
role: "admin",
data: {
desc: "Admin key for prod app database"
}
}
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!