Versions in this module Expand all Collapse all v1 v1.1.0 Dec 9, 2020 Changes in this version + func GetMgoClient(config map[string]string) (*mongo.Client, error) + type CollectionContent struct + Collection *mongo.Collection + CollectionName string + Database *mongo.Database + DatabaseName string + func (mgo *CollectionContent) IsCreateIndex() (c *CollectionContent, isCreate bool) + func (mgo *CollectionContent) SetIndex(elems []string) *CollectionContent + func (mgo *CollectionContent) SetIndexDesc(elems []string) *CollectionContent + func (mgo *CollectionContent) SetUnique(elems []string) *CollectionContent + func (mgo *CollectionContent) SetUniqueDesc(elems []string) *CollectionContent + type IMgoRepository interface + Delete func(id interface{}) (count int, err error) + DeleteMany func(ids ...interface{}) (count int, err error) + Find func(filterKey string, filterValue interface{}, result interface{}) (err error) + FindById func(filterValue interface{}, result interface{}) (err error) + FindCount func(filterMap map[string]interface{}) (count int64, err error) + FindMany func(filterMap map[string]interface{}, result interface{}) (err error) + FindPage func(filterMap map[string]interface{}, pageIndex, size int64, sortName string, ...) (totalCount int64, err error) + Insert func(entity interface{}) (count int, err error) + InsertMany func(entity []interface{}) (count int, err error) + Update func(filterKey string, filterValue interface{}, entity interface{}) (count int, err error) + type MgoContent struct + Database *mongo.Database + DatabaseName string + func DataBaseMapping(client *mongo.Client, dataName string) *MgoContent + func (mgo *MgoContent) GetCollection(entity interface{}) *CollectionContent + func (mgo *MgoContent) GetMgoRepository(entity interface{}) IMgoRepository + type MgoRepository struct + func (mgo *MgoRepository) Delete(id interface{}) (count int, err error) + func (mgo *MgoRepository) DeleteMany(ids ...interface{}) (count int, err error) + func (mgo *MgoRepository) Find(filterKey string, filterValue interface{}, result interface{}) (err error) + func (mgo *MgoRepository) FindById(filterValue interface{}, result interface{}) (err error) + func (mgo *MgoRepository) FindCount(filterMap map[string]interface{}) (count int64, err error) + func (mgo *MgoRepository) FindMany(filterMap map[string]interface{}, result interface{}) (err error) + func (mgo *MgoRepository) FindPage(filterMap map[string]interface{}, pageIndex, size int64, sortName string, ...) (totalCount int64, err error) + func (mgo *MgoRepository) Insert(entity interface{}) (count int, err error) + func (mgo *MgoRepository) InsertMany(entity []interface{}) (count int, err error) + func (mgo *MgoRepository) Update(filterKey string, filterValue interface{}, entity interface{}) (count int, err error)