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(Customer.byId("111"))
{
  data: [
    {
      id: "371233004820889634",
      coll: Token,
      ts: Time("2099-07-25T14:10:32.165Z"),
      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!