Get the Set of accessible Tokens in the database.


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

Token.where(predicate: (val: Token) => Boolean)): Set<Token>


Each Token in a Fauna database is represented by a Token object. Token.where() gets the Set of accessible Token objects that match the predicate function.

The predicate function must return a Boolean.

If where() is the last value in a query, the first page of the Set is returned.


Parameter Type Required Description



An anonymous function that compares values in each Token document and returns true for matches or false for mismatches. If no document matches exist or are accessible, this method returns null.

predicate parameters:

Parameter Type Required Description



Token object to compare. If omitted, use dot notation to access Token properties.

Return value

Type Description


Set representing the documents that match the predicate function. If this method is the last value in a query, the method returns the first page of the Set. Returns an empty set if there are no matches.


Token.where( == "372696914650464289")
  data: [
      id: "373081653342371873",
      coll: Token,
      ts: Time("2023-08-14T23:54:00.750Z"),
      document: People.byId("372696914650464289")
      id: "373081673116418081",
      coll: Token,
      ts: Time("2023-08-14T23:54:19.610Z"),
      document: People.byId("372696914650464289")

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email

Thank you for your feedback!