Versions in this module Expand all Collapse all v1 v1.2.1 Mar 6, 2021 Changes in this version + func NewModelManager(url, dbname string) + type Model struct + AppID bson.ObjectId + CreatedAt int64 + Id bson.ObjectId + Invalid bool + InvalidAt int64 + UpdatedAt int64 + type ModelManager struct + func (this *ModelManager) C(name string) *mgo.Collection + func (this *ModelManager) Count(cName string, selector bson.M) (count int, err error) + func (this *ModelManager) DropCollection(cName string) (err error) + func (this *ModelManager) FindAll(cName string, query bson.M, results interface{}) (err error) + func (this *ModelManager) FindOne(cName string, query bson.M, result interface{}) (err error) + func (this *ModelManager) GetMongoDB() *MongoDB + func (this *ModelManager) Insert(cName string, model interface{}) (err error) + func (this *ModelManager) Remove(cName string, selector bson.M) (err error) + func (this *ModelManager) RemoveWithId(cName string, id bson.ObjectId) (err error) + func (this *ModelManager) Session(callback func(s *mgo.Session)) + func (this *ModelManager) Update(cName string, selector bson.M, update interface{}) (err error) + func (this *ModelManager) UpdateAll(cName string, selector bson.M, update interface{}) (info *mgo.ChangeInfo, err error) + func (this *ModelManager) UpdateWithId(cName string, id bson.ObjectId, update interface{}) (err error) + type MongoDB struct + func NewMongoDB(url, dbName string) *MongoDB + func (this *MongoDB) C(name string) *mgo.Collection + func (this *MongoDB) MainSession() *mgo.Session + func (this *MongoDB) NewSession() *mgo.Session + type MongoDBClient struct + func (this MongoDBClient) Close()