Documentation ¶
Index ¶
- Variables
- type Model
- 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 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 interface{}, 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 interface{}, id interface{}) error
- func (mm *Model) FindOneNoCache(v interface{}, 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
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = mgo.ErrNotFound
)
Functions ¶
This section is empty.
Types ¶
type Model ¶
func MustNewModel ¶
func MustNewNodeModel ¶
func NewNodeModel ¶
func (*Model) FindAllNoCache ¶
func (mm *Model) FindAllNoCache(v interface{}, query interface{}, opts ...QueryOption) error
func (*Model) FindOneIdNoCache ¶
func (*Model) FindOneNoCache ¶
func (*Model) GetCollection ¶
func (*Model) RemoveAll ¶
func (mm *Model) RemoveAll(selector interface{}, keys ...string) (*mgo.ChangeInfo, error)
func (*Model) RemoveAllNoCache ¶
func (mm *Model) RemoveAllNoCache(selector interface{}) (*mgo.ChangeInfo, error)
func (*Model) RemoveIdNoCache ¶
func (*Model) RemoveNoCache ¶
func (*Model) UpdateIdNoCache ¶
func (*Model) UpdateNoCache ¶
func (*Model) Upsert ¶
func (mm *Model) Upsert(selector, update interface{}, keys ...string) (*mgo.ChangeInfo, error)
func (*Model) UpsertNoCache ¶
func (mm *Model) UpsertNoCache(selector, update interface{}) (*mgo.ChangeInfo, error)
Click to show internal directories.
Click to hide internal directories.