Documentation ¶
Index ¶
- func CreateAdvancedFilterQuery(key string, operation string, value interface{}) string
- func CreateBSONFilterQuery(filter bson.M) string
- func CreateFilterQuery(values ...interface{}) string
- func GetMultipleObjects[T any](filter string, dbName string, collectionName string) ([]T, error)
- func GetObject[T any](filter string, dbName string, collectionName string) (T, error)
- func Init(configPath string) error
- func PerformDatabaseAction(dbName string, collectionName string, givenAction ActionET, ...) error
- type ActionET
- type InitData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAdvancedFilterQuery ¶
Creates a complex BSON filter query i.e. bson.M{"key": bson.M{"operation": value}} e.g. bson.M{"age": bson.M{"$ne": 42}}
func CreateBSONFilterQuery ¶
Takes any BSON and creates a filter query Allows for more flexibility than CreateAdvancedFilterQuery, however bson.M must then be included in the package that is calling this function.
func CreateFilterQuery ¶
func CreateFilterQuery(values ...interface{}) string
Creates simple filter queries i.e. "key1", "value1", "key2", "value2", etc. e.g. "id", 5, "name", "John", "age", 42
func GetMultipleObjects ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.