Credential.create()

Create a credential.

Signature

Credential.create(data: {*: Any}): <Document>

Description

The Credential.create() method creates a credential with the provided data.

Parameters

Parameter Type Required Description

data

Object

Yes

Object describing the credential.

data fields

Name Type Required Description

document

String

Yes

Document associated with the credential.

password

String

Authorization password associated with the credential.

Return value

Type Description

Credential

New Credential document. See Credential document definition.

Examples

Credentials.create({
  document: People.byId("372696914650464289"),
  password: "sekret"
})
{
  id: "373081348103995425",
  coll: Credential,
  ts: Time("2023-08-14T23:49:09.650Z"),
  document: People.byId("372696914650464289")
}

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!