MCPcopy
hub / github.com/pocketbase/pocketbase / AddMarshaledJSONAt

Method AddMarshaledJSONAt

core/fields_list.go:170–179  ·  view source on GitHub ↗

AddMarshaledJSONAt is the same as AddMarshaledJSON but insert/move the fields at the specific position. If pos < 0, then this method acts the same as calling AddMarshaledJSON. If pos > FieldsList total items, then the specified fields are inserted/moved at the end of the list.

(pos int, rawJSON []byte)

Source from the content-addressed store, hash-verified

168//
169// If pos > FieldsList total items, then the specified fields are inserted/moved at the end of the list.
170func (l *FieldsList) AddMarshaledJSONAt(pos int, rawJSON []byte) error {
171 extractedFields, err := marshaledJSONtoFieldsList(rawJSON)
172 if err != nil {
173 return err
174 }
175
176 l.AddAt(pos, extractedFields...)
177
178 return nil
179}
180
181func marshaledJSONtoFieldsList(rawJSON []byte) (FieldsList, error) {
182 extractedFields := FieldsList{}

Callers 1

Calls 2

AddAtMethod · 0.95

Tested by 1