Token.byId()

Learn: Tokens

Get a token by its document id.

Signature

Token.byId(id: ID) => Ref<Token>

Description

Gets a token, represented as an Token document, by its document id.

A token is a type of authentication secret used to provide identity-based access to a Fauna database. Fauna stores tokens as documents in the Token system collection.

Parameters

Parameter Type Required Description

id

String

true

ID of the Token document to retrieve.

Return value

Type Description

Ref<Token>

Resolved reference to the Token document. Can resolve to an existing document or a NullDoc.

Examples

Token.byId("371233004820889634")
{
  id: "371233004820889634",
  coll: Token,
  ts: Time("2099-07-25T14:10:32.165Z"),
  document: Customer("111")
}
\