Back to Pocketbase

Function unmarshal

static/jsvm/functions/unmarshal.html

latest910 B
Original Source

Function unmarshal

  • unmarshal(data, dst): void

unmarshal clones and merges the data argument on top of dst.

This method is rarely used directly by the users and it is most commonly used in the autogenerated migrations.

To an extent it is similar to the JS native Object.assign but the arguments are reversed and it invokes the Go standard json.Marshal/Unmarshal methods under the hood.

The data argument could be anything serializable, usually a plain object (map). The dst argument could be any pointer value, usually a model instance.

Example:

unmarshal({ authAlert: { enabled: true } }, collection)Copy

Parameters

data: any
dst: any

Returns void

Settings

Member Visibility

  • Inherited

Theme

OSLightDark

Generated using TypeDoc