MCPcopy
hub / github.com/pocketbase/pocketbase / RemoveById

Method RemoveById

core/fields_list.go:86–94  ·  view source on GitHub ↗

RemoveById removes a single field by its id. This method does nothing if field with the specified id doesn't exist.

(fieldId string)

Source from the content-addressed store, hash-verified

84//
85// This method does nothing if field with the specified id doesn't exist.
86func (l *FieldsList) RemoveById(fieldId string) {
87 fields := *l
88 for i, field := range fields {
89 if field.GetId() == fieldId {
90 *l = append(fields[:i], fields[i+1:]...)
91 return
92 }
93 }
94}
95
96// RemoveByName removes a single field by its name.
97//

Callers 2

TestFieldsListRemoveFunction · 0.95

Calls 1

GetIdMethod · 0.65

Tested by 2

TestFieldsListRemoveFunction · 0.76