Key.byId()

Get Key by its document ID.

Signature

Key.byId(id: id) => Ref<Key>

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

Type Description

Ref<Key>

Resolved reference to a Key document. Can resolve to an existing document or a 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!