Token.byDocument()

Get a Token document.

Signature

Token.byDocument(document: Document): Token | TokenNull

Description

This method returns the set of tokens associated with document. An identity may have multiple tokens.

Parameters

Parameter Type Required Description

document

Object

Document object.

Return value

Type Description

Set<Token>

All tokens in the current database document_not_found if document doesn’t exist.

Examples

Token.byDocument(People.byId("370723013175279650"))
{
  data: [
    {
      id: "371233004820889634",
      coll: Token,
      ts: Time("2023-07-25T14:10:32.165Z"),
      document: People.byId("370723013175279650")
    },
    {
      id: "371233060625055778",
      coll: Token,
      ts: Time("2023-07-25T14:11:25.360Z"),
      document: People.byId("370723013175279650")
    }
  ]
}

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!