NewViewCollection initializes and returns a new "view" Collection model. It also loads the minimal default configuration for the collection (eg. system fields, indexes, type specific options, etc.).
(name string, optId ...string)
| 425 | // It also loads the minimal default configuration for the collection |
| 426 | // (eg. system fields, indexes, type specific options, etc.). |
| 427 | func NewViewCollection(name string, optId ...string) *Collection { |
| 428 | m := &Collection{} |
| 429 | m.Name = name |
| 430 | m.Type = CollectionTypeView |
| 431 | |
| 432 | // @todo consider removing once inferred composite literals are supported |
| 433 | if len(optId) > 0 { |
| 434 | m.Id = optId[0] |
| 435 | } |
| 436 | |
| 437 | m.initDefaultId() |
| 438 | m.initDefaultFields() |
| 439 | |
| 440 | return m |
| 441 | } |
| 442 | |
| 443 | // NewAuthCollection initializes and returns a new "auth" Collection model. |
| 444 | // |
searching dependent graphs…