update()

Update an access provider.

Signature

update(object: {*: Any}): { *: Any }

Description

The update() method updates the provider with the object fields and returns the updated provider. During the update, fields from object are copied to the document, creating new fields or updating existing fields. The operation is similar to a merge.

Only the fields included in object are updated, all other document fields aren’t updated. Fields with nested objects in object are merged with the identically named nested object in the document.

To remove a document field, set its value in object to null.

Parameters

Parameter Type Required Description

object

Object

Yes

Object with the updated fields.

Return value

Type Description

Object

Provider with updated fields.

Examples

AccessProvider.byName("justFineAccessProvider")!.update({

  name: "theAccessProvider",
  issuer: "https://fauna-updated.auth0.com",
  roles: "humanResources"
})
{
  name: "theAccessProvider",
  coll: AccessProvider,
  ts: Time("2023-07-28T03:52:58.610Z"),
  roles: "humanResources",
  issuer: "https://fauna-updated.auth0.com",
  jwks_uri: "https://fauna.auth0.com/.well-known/jwks.json",
  audience: "https://db.fauna.com/db/ywtfhw4poyynr"
}

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!