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)
| 405 | // It also loads the minimal default configuration for the collection |
| 406 | // (eg. system fields, indexes, type specific options, etc.). |
| 407 | func 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 | // |
searching dependent graphs…