Documentation
¶
Index ¶
- func ConnectDb(config *MongodbConfig)
- func CreateCollection(dbName string, collectionName string)
- func CreateCollections(dbName string, collections []string)
- func CreateIndex(dbName string, collectionName string, indexModel mongo.IndexModel)
- func CreateUniqueIndex(dbName string, collectionName string, field string)
- func GetClient() *mongo.Client
- func GetDb(dbName string) *mongo.Database
- type MongodbConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectDb ¶
func ConnectDb(config *MongodbConfig)
Connect Mongodb function will initialize and connect to mongodb based on the URL, Port and Host passed via config
func CreateCollection ¶ added in v1.1.3
Create Collection
func CreateCollections ¶
Create Collections
func CreateIndex ¶ added in v1.1.0
func CreateIndex(dbName string, collectionName string, indexModel mongo.IndexModel)
func CreateUniqueIndex ¶ added in v1.1.0
Types ¶
Click to show internal directories.
Click to hide internal directories.