Versions in this module Expand all Collapse all v0 v0.0.2 Jun 5, 2022 Changes in this version + var ErrNotFound = mgo.ErrNotFound + type CachedCollection interface + Count func(query interface{}) (int, error) + DelCache func(keys ...string) error + FindAllNoCache func(v, query interface{}, opts ...QueryOption) error + FindOne func(v interface{}, key string, query interface{}) error + FindOneId func(v interface{}, key string, id interface{}) error + FindOneIdNoCache func(v, id interface{}) error + FindOneNoCache func(v, query interface{}) error + GetCache func(key string, v interface{}) error + Insert func(docs ...interface{}) error + Pipe func(pipeline interface{}) mongo.Pipe + Remove func(selector interface{}, keys ...string) error + RemoveAll func(selector interface{}, keys ...string) (*mgo.ChangeInfo, error) + RemoveAllNoCache func(selector interface{}) (*mgo.ChangeInfo, error) + RemoveId func(id interface{}, keys ...string) error + RemoveIdNoCache func(id interface{}) error + RemoveNoCache func(selector interface{}) error + SetCache func(key string, v interface{}) error + Update func(selector, update interface{}, keys ...string) error + UpdateId func(id, update interface{}, keys ...string) error + UpdateIdNoCache func(id, update interface{}) error + UpdateNoCache func(selector, update interface{}) error + Upsert func(selector, update interface{}, keys ...string) (*mgo.ChangeInfo, error) + UpsertNoCache func(selector, update interface{}) (*mgo.ChangeInfo, error) + type Model struct + func MustNewModel(url, collection string, c cache.CacheConf, opts ...cache.Option) *Model + func MustNewNodeModel(url, collection string, rds *redis.Redis, opts ...cache.Option) *Model + func NewModel(url, collection string, conf cache.CacheConf, opts ...cache.Option) (*Model, error) + func NewModelWithCache(url, collection string, c cache.Cache) (*Model, error) + func NewNodeModel(url, collection string, rds *redis.Redis, opts ...cache.Option) (*Model, error) + func (mm *Model) Count(query interface{}) (int, error) + func (mm *Model) DelCache(keys ...string) error + func (mm *Model) FindAllNoCache(v, query interface{}, opts ...QueryOption) error + func (mm *Model) FindOne(v interface{}, key string, query interface{}) error + func (mm *Model) FindOneId(v interface{}, key string, id interface{}) error + func (mm *Model) FindOneIdNoCache(v, id interface{}) error + func (mm *Model) FindOneNoCache(v, query interface{}) error + func (mm *Model) GetCache(key string, v interface{}) error + func (mm *Model) GetCollection(session *mgo.Session) CachedCollection + func (mm *Model) Insert(docs ...interface{}) error + func (mm *Model) Pipe(pipeline interface{}) (mongo.Pipe, error) + func (mm *Model) Remove(selector interface{}, keys ...string) error + func (mm *Model) RemoveAll(selector interface{}, keys ...string) (*mgo.ChangeInfo, error) + func (mm *Model) RemoveAllNoCache(selector interface{}) (*mgo.ChangeInfo, error) + func (mm *Model) RemoveId(id interface{}, keys ...string) error + func (mm *Model) RemoveIdNoCache(id interface{}) error + func (mm *Model) RemoveNoCache(selector interface{}) error + func (mm *Model) SetCache(key string, v interface{}) error + func (mm *Model) Update(selector, update interface{}, keys ...string) error + func (mm *Model) UpdateId(id, update interface{}, keys ...string) error + func (mm *Model) UpdateIdNoCache(id, update interface{}) error + func (mm *Model) UpdateNoCache(selector, update interface{}) error + func (mm *Model) Upsert(selector, update interface{}, keys ...string) (*mgo.ChangeInfo, error) + func (mm *Model) UpsertNoCache(selector, update interface{}) (*mgo.ChangeInfo, error) + type QueryOption func(query mongo.Query) mongo.Query