Documentation ¶
Index ¶
- func Find(collectionName string, selector map[string]interface{}, ...) *common.Error
- func FindOne(collectionName string, selector map[string]interface{}, ...) *common.Error
- func Insert(collectionName string, doc interface{}, result *[]interface{}) *common.Error
- func InvalidObjectIdError(objectId string) *common.Error
- func MongoDBError(b error) *common.Error
- func ObjectAlreadyExistsError(objectName string) *common.Error
- func ObjectNotExistsError(objectName string) *common.Error
- func Remove(collectionName string, selector map[string]interface{}, result *[]interface{}) *common.Error
- func SetMongoDBInv(mongoDB settings.DBConfig)
- func StartMongod()
- func TestMongoConnection()
- func Update(collectionName string, selector map[string]interface{}, update interface{}, ...) *common.Error
- func Upsert(collectionName string, selector map[string]interface{}, update interface{}, ...) *common.Error
- type AtlasMongo
- type DB
- type Database
- type LocalMongo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidObjectIdError ¶
func MongoDBError ¶
func ObjectNotExistsError ¶
func SetMongoDBInv ¶
func StartMongod ¶
func StartMongod()
func TestMongoConnection ¶
func TestMongoConnection()
Types ¶
type AtlasMongo ¶
func (*AtlasMongo) GetCollection ¶
func (mi *AtlasMongo) GetCollection(collectionName string) *mongo.Collection
func (*AtlasMongo) GetDatabaseConfig ¶
func (mi *AtlasMongo) GetDatabaseConfig() *Database
func (*AtlasMongo) GetSession ¶
func (mi *AtlasMongo) GetSession() *mongo.Client
type DB ¶
type DB interface { GetSession() *mongo.Client GetDatabaseConfig() *Database GetCollection(collectionName string) *mongo.Collection }
var Instance DB
type LocalMongo ¶
func (*LocalMongo) GetCollection ¶
func (mi *LocalMongo) GetCollection(collectionName string) *mongo.Collection
func (*LocalMongo) GetDatabaseConfig ¶
func (mi *LocalMongo) GetDatabaseConfig() *Database
func (*LocalMongo) GetSession ¶
func (mi *LocalMongo) GetSession() *mongo.Client
Click to show internal directories.
Click to hide internal directories.