update()

Update function fields.

Signature

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

Description

The update() method updates the Function definition with the given object values. The object must have valid field names.

Parameters

Parameter Type Required Description

object

Object

Yes

Function field and values to update.

Return value

Type Description

FunctionDef

Function definition with updated fields.

Examples

Function.byName("double")!.update({
  name: "triple",
  body: "x => x * 3"
})
{
  name: "triple",
  coll: Function,
  ts: Time("2023-11-09T10:36:59.590Z"),
  body: "x => x * 3"
}

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!