Credential.byDocument()

Get credential by document.

Signature

Credential.byDocument(document: Document): Credential | Null

Description

This method returns the Credential object associated with the document.

Parameters

Parameter Type Required Description

document

Object

Yes

Document object with credentials.

Return value

Type Description

Credential

The credential associated with document.

NullCredential

no credentials or doesn’t exist.

Examples

let document = People.byId("371264255805095970")
Credentials.byDocument(document)
{
  id: "371264255814533154",
  coll: Credential,
  ts: Time("2023-07-26T21:57:08.286Z"),
  document: People.byId("371264255805095970")
}

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!