MCPcopy
hub / github.com/pocketbase/pocketbase / NewBaseCollection

Function NewBaseCollection

core/collection_model.go:407–421  ·  view source on GitHub ↗

NewBaseCollection initializes and returns a new "base" Collection model. It also loads the minimal default configuration for the collection (eg. system fields, indexes, type specific options, etc.).

(name string, optId ...string)

Source from the content-addressed store, hash-verified

405// It also loads the minimal default configuration for the collection
406// (eg. system fields, indexes, type specific options, etc.).
407func NewBaseCollection(name string, optId ...string) *Collection {
408 m := &Collection{}
409 m.Name = name
410 m.Type = CollectionTypeBase
411
412 // @todo consider removing once inferred composite literals are supported
413 if len(optId) > 0 {
414 m.Id = optId[0]
415 }
416
417 m.initDefaultId()
418 m.initDefaultFields()
419
420 return m
421}
422
423// NewViewCollection initializes and returns a new "view" Collection model.
424//

Calls 2

initDefaultIdMethod · 0.95
initDefaultFieldsMethod · 0.95

Used in the wild real call sites across dependent graphs

searching dependent graphs…