MCPcopy
hub / github.com/pocketbase/pocketbase / SetExpand

Method SetExpand

core/record_model.go:684–690  ·  view source on GitHub ↗

SetExpand replaces the current Record's expand with the provided expand arg data (shallow copied).

(expand map[string]any)

Source from the content-addressed store, hash-verified

682
683// SetExpand replaces the current Record's expand with the provided expand arg data (shallow copied).
684func (m *Record) SetExpand(expand map[string]any) {
685 if m.expand == nil {
686 m.expand = store.New[string, any](nil)
687 }
688
689 m.expand.Reset(expand)
690}
691
692// MergeExpand merges recursively the provided expand data into
693// the current model's expand (if any).

Callers 10

TestRecordExpandFunction · 0.95
TestRecordMergeExpandFunction · 0.95
TestRecordExpandedOneFunction · 0.95
TestRecordExpandedAllFunction · 0.95
SetMethod · 0.95
expandRecordsMethod · 0.80
TestRecordOriginalFunction · 0.80
TestRecordFreshFunction · 0.80
TestRecordCloneFunction · 0.80
CloneMethod · 0.80

Calls 1

ResetMethod · 0.45

Tested by 7

TestRecordExpandFunction · 0.76
TestRecordMergeExpandFunction · 0.76
TestRecordExpandedOneFunction · 0.76
TestRecordExpandedAllFunction · 0.76
TestRecordOriginalFunction · 0.64
TestRecordFreshFunction · 0.64
TestRecordCloneFunction · 0.64