mongo

package
v0.0.0-...-905eacb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToMongo

func ConnectToMongo(dbConfig *DatabaseConfig) (*mongo.Database, error)

ConnectToMongo establishes a connection to MongoDB using the provided configuration.

func CreateUniqueIndexOnAFields

func CreateUniqueIndexOnAFields(collection mongoORM.MongoCollectionDerived, indexModel bson.D) error

func DisconnectFromMongo

func DisconnectFromMongo(ctx context.Context) error

DisconnectFromMongo disconnects from MongoDB.

func GetMongoCollection

func GetMongoCollection(collectionName string, opts ...*options.CollectionOptions) mongoORM.MongoCollectionDerived

func GetMongoDBInstance

func GetMongoDBInstance(dbConfig *DatabaseConfig) (*mongo.Database, error)

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host      string `yaml:"host"`
	Port      int    `yaml:"port"`
	DBName    string `yaml:"dbname"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	UserTable string `yaml:"usertable"`
	JobTable  string `yaml:"jobtable"`
}

Directories

Path Synopsis
implements the MongoCollectionDerived interface which is a derived interface from the MongoCollection interface.
implements the MongoCollectionDerived interface which is a derived interface from the MongoCollection interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL