DataStoreNames returns the names of all datastores connected to this database
()
| 2552 | |
| 2553 | // DataStoreNames returns the names of all datastores connected to this database |
| 2554 | func (db *Database) DataStoreNames() base.ScopeAndCollectionNames { |
| 2555 | if db.Scopes == nil { |
| 2556 | return base.ScopeAndCollectionNames{ |
| 2557 | base.DefaultScopeAndCollectionName(), |
| 2558 | } |
| 2559 | } |
| 2560 | var names base.ScopeAndCollectionNames |
| 2561 | for scopeName, scope := range db.Scopes { |
| 2562 | for collectionName := range scope.Collections { |
| 2563 | names = append(names, base.ScopeAndCollectionName{Scope: scopeName, Collection: collectionName}) |
| 2564 | } |
| 2565 | } |
| 2566 | return names |
| 2567 | } |
| 2568 | |
| 2569 | // GetCollectionIDs will return all collection IDs for all collections configured on the database |
| 2570 | func (db *DatabaseContext) GetCollectionIDs() []uint32 { |