Key.byId()

Get Key by its document ID.

Signature

Key.byId(id: id) => Key | NullKey

Description

Gets the associated Key document if it exists and is accessible.

Parameters

Parameter Type Required Description

id

String

Yes

ID of the document to get.

Return value

One of:

Type Description

Key

Key document.

NullKey

Document doesn’t exist or is inaccessible. See NullDoc.

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!