MCPcopy
hub / github.com/pocketbase/pocketbase / UnmarshalJSONField

Method UnmarshalJSONField

core/record_model.go:1020–1022  ·  view source on GitHub ↗

Retrieves the "key" json field value and unmarshals it into "result". Example result := struct { FirstName string `json:"first_name"` }{} err := m.UnmarshalJSONField("my_field_name", &result)

(key string, result any)

Source from the content-addressed store, hash-verified

1018// }{}
1019// err := m.UnmarshalJSONField("my_field_name", &result)
1020func (m *Record) UnmarshalJSONField(key string, result any) error {
1021 return json.Unmarshal([]byte(m.GetString(key)), &result)
1022}
1023
1024// ExpandedOne retrieves a single relation Record from the already
1025// loaded expand data of the current model.

Callers 1

Calls 1

GetStringMethod · 0.95

Tested by 1