mongoc

package
v1.1.5-0...-dfb45c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = mgo.ErrNotFound
)

Functions

This section is empty.

Types

type Model

type Model struct {
	*mongo.Model
	// contains filtered or unexported fields
}

func MustNewModel

func MustNewModel(url, collection string, c cache.CacheConf, opts ...cache.Option) *Model

func MustNewNodeModel

func MustNewNodeModel(url, collection string, rds *redis.Redis, opts ...cache.Option) *Model

func NewModel

func NewModel(url, collection string, conf cache.CacheConf, opts ...cache.Option) (*Model, error)

func NewNodeModel

func NewNodeModel(url, collection string, rds *redis.Redis, opts ...cache.Option) (*Model, error)

func (*Model) Count

func (mm *Model) Count(query interface{}) (int, error)

func (*Model) DelCache

func (mm *Model) DelCache(keys ...string) error

func (*Model) FindAllNoCache

func (mm *Model) FindAllNoCache(v interface{}, query interface{}, opts ...QueryOption) error

func (*Model) FindOne

func (mm *Model) FindOne(v interface{}, key string, query interface{}) error

func (*Model) FindOneId

func (mm *Model) FindOneId(v interface{}, key string, id interface{}) error

func (*Model) FindOneIdNoCache

func (mm *Model) FindOneIdNoCache(v interface{}, id interface{}) error

func (*Model) FindOneNoCache

func (mm *Model) FindOneNoCache(v interface{}, query interface{}) error

func (*Model) GetCache

func (mm *Model) GetCache(key string, v interface{}) error

func (*Model) GetCollection

func (mm *Model) GetCollection(session *mgo.Session) *cachedCollection

func (*Model) Insert

func (mm *Model) Insert(docs ...interface{}) error

func (*Model) Pipe

func (mm *Model) Pipe(pipeline interface{}) (mongo.Pipe, error)

func (*Model) Remove

func (mm *Model) Remove(selector interface{}, keys ...string) error

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) RemoveId

func (mm *Model) RemoveId(id interface{}, keys ...string) error

func (*Model) RemoveIdNoCache

func (mm *Model) RemoveIdNoCache(id interface{}) error

func (*Model) RemoveNoCache

func (mm *Model) RemoveNoCache(selector interface{}) error

func (*Model) SetCache

func (mm *Model) SetCache(key string, v interface{}) error

func (*Model) Update

func (mm *Model) Update(selector, update interface{}, keys ...string) error

func (*Model) UpdateId

func (mm *Model) UpdateId(id, update interface{}, keys ...string) error

func (*Model) UpdateIdNoCache

func (mm *Model) UpdateIdNoCache(id, update interface{}) error

func (*Model) UpdateNoCache

func (mm *Model) UpdateNoCache(selector, update interface{}) error

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)

type QueryOption

type QueryOption func(query mongo.Query) mongo.Query

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL