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.

Token.where()

Learn: Tokens

Get a Set of tokens that match a provided predicate.

Signature

Token.where(pred: (Token => Boolean)) => Set<Token>

Description

Gets a Set of tokens, represented as Token documents, that match a provided predicate function.

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.

If Token.where() is the last expression in a query, the first page of the Set is returned. See Pagination.

Parameters

Parameter Type Required Description

pred

Predicate function

Yes

Anonymous predicate function that:

The method returns a Set of Token documents for which the predicate returns true.

Return value

Type Description

Set<Token>

Set of Token documents that match the predicate. If there are no matching documents, the Set is empty.

Examples

Token.where(.document.id == "111")
{
  data: [
    {
      id: "401670938431586381",
      coll: Token,
      ts: Time("2099-08-14T23:54:00.750Z"),
      document: Customer("111")
    },
    ...
  ]
}

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!