Collection returns the Collection model associated to the current Record model.
ColumnValueMap implements [ColumnValueMapper] interface.
Expand returns a shallow copy of the current Record model expand data.
ExpandedAll retrieves a slice of relation Records from the already loaded expand data of the current model.
If the requested expand relation is single, this method normalizes the return result and will wrap the single model as a slice.
Returns nil slice if there is no such expand relation loaded.
ExpandedOne retrieves a single relation Record from the already loaded expand data of the current model.
If the requested expand relation is multiple, this method returns only first available Record from the expanded relation.
Returns nil if there is no such expand relation loaded.
FindFileFieldByFile returns the first file type field for which any of the record's data contains the provided filename.
Load bulk loads the provided data into the current Record model.
MergeExpand merges recursively the provided expand data into the current model's expand (if any).
Note that if an expanded prop with the same key is a slice (old or new expand) then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew).
PublicExport exports only the record fields that are safe to be public.
For auth records, to force the export of the email field you need to set
m.IgnoreEmailVisibility(true)
.
ReplaceModifers returns a new map with applied modifier values based on the current record and the specified data.
The resolved modifier keys will be removed.
Multiple modifiers will be applied one after another, while reusing the previous base key value result (eg. 1; -5; +2 => -2).
Example usage:
newData := record.ReplaceModifers(data)
// record: {"field": 10}
// data: {"field+": 5}
// newData: {"field": 15}
SchemaData returns a shallow copy ONLY of the defined record schema fields data.
SetExpand shallow copies the provided data to the current Record model's expand.
SetPassword sets cryptographically secure string to the auth record "password" field. This method also resets the "lastResetSentAt" and the "tokenKey" fields.
Returns an error if the record is not from an auth collection or an empty password is provided.
UnknownData returns a shallow copy ONLY of the unknown record fields data, aka. fields that are neither one of the base and special system ones, nor defined by the collection schema.
Generated using TypeDoc
BaseFilesPath returns the storage dir path used by the record.