Documentation ¶
Index ¶
- Variables
- func Set(db *Database)
- type Database
- func (db *Database) DbPropsCollection() *mongo.Collection
- func (db *Database) GetSchemaVersion(ctx context.Context) (int, int, error)
- func (db *Database) UpdateIndexes() error
- func (db *Database) UpdateIndexesTo(version int) error
- func (db *Database) UpdateSchemas() error
- func (db *Database) UpdateSchemasTo(version int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var MongoDatabaseName = utils.GetCloudProjectID()
MongoDatabaseName is the name of the database in MongoDB
Functions ¶
Types ¶
type Database ¶
Database interface abstracts database operations
func (*Database) DbPropsCollection ¶ added in v0.11.0
func (db *Database) DbPropsCollection() *mongo.Collection
DbPropsCollection is the collection for database properties
func (*Database) GetSchemaVersion ¶ added in v1.0.0
GetSchemaVersion returns (cur, latest) schema version
func (*Database) UpdateIndexes ¶ added in v0.11.0
UpdateIndexes if necessary
func (*Database) UpdateIndexesTo ¶ added in v0.11.0
UpdateIndexesTo to a particular version
func (*Database) UpdateSchemas ¶ added in v1.0.0
UpdateSchemas if necessary
func (*Database) UpdateSchemasTo ¶ added in v1.0.0
UpdateSchemasTo to a particular version
Click to show internal directories.
Click to hide internal directories.