NewCollection initializes and returns a new Collection model with the specified type and name. It also loads the minimal default configuration for the collection (eg. system fields, indexes, type specific options, etc.).
(typ, name string, optId ...string)
| 390 | // It also loads the minimal default configuration for the collection |
| 391 | // (eg. system fields, indexes, type specific options, etc.). |
| 392 | func NewCollection(typ, name string, optId ...string) *Collection { |
| 393 | switch typ { |
| 394 | case CollectionTypeAuth: |
| 395 | return NewAuthCollection(name, optId...) |
| 396 | case CollectionTypeView: |
| 397 | return NewViewCollection(name, optId...) |
| 398 | default: |
| 399 | return NewBaseCollection(name, optId...) |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | // NewBaseCollection initializes and returns a new "base" Collection model. |
| 404 | // |
searching dependent graphs…