Versions in this module Expand all Collapse all v1 v1.4.4 Nov 9, 2022 v1.4.3 Nov 9, 2022 Changes in this version + var ErrNotFound = mongo.ErrNoDocuments + type Model struct + func MustNewModel(uri, db, collection string, c cache.CacheConf, opts ...cache.Option) *Model + func MustNewNodeModel(uri, db, collection string, rds *redis.Redis, opts ...cache.Option) *Model + func NewModel(uri, db, collection string, conf cache.CacheConf, opts ...cache.Option) (*Model, error) + func NewModelWithCache(uri, db, collection string, c cache.Cache) (*Model, error) + func NewNodeModel(uri, db, collection string, rds *redis.Redis, opts ...cache.Option) (*Model, error) + func (mm *Model) DelCache(ctx context.Context, keys ...string) error + func (mm *Model) DeleteOne(ctx context.Context, key string, filter interface{}, ...) (int64, error) + func (mm *Model) DeleteOneNoCache(ctx context.Context, filter interface{}, opts ...*mopt.DeleteOptions) (int64, error) + func (mm *Model) FindOne(ctx context.Context, key string, v, filter interface{}, ...) error + func (mm *Model) FindOneAndDelete(ctx context.Context, key string, v, filter interface{}, ...) error + func (mm *Model) FindOneAndDeleteNoCache(ctx context.Context, v, filter interface{}, ...) error + func (mm *Model) FindOneAndReplace(ctx context.Context, key string, v, filter interface{}, ...) error + func (mm *Model) FindOneAndReplaceNoCache(ctx context.Context, v, filter interface{}, replacement interface{}, ...) error + func (mm *Model) FindOneAndUpdate(ctx context.Context, key string, v, filter interface{}, update interface{}, ...) error + func (mm *Model) FindOneAndUpdateNoCache(ctx context.Context, v, filter interface{}, update interface{}, ...) error + func (mm *Model) FindOneNoCache(ctx context.Context, v, filter interface{}, opts ...*mopt.FindOneOptions) error + func (mm *Model) GetCache(key string, v interface{}) error + func (mm *Model) InsertOne(ctx context.Context, key string, document interface{}, ...) (*mongo.InsertOneResult, error) + func (mm *Model) InsertOneNoCache(ctx context.Context, document interface{}, opts ...*mopt.InsertOneOptions) (*mongo.InsertOneResult, error) + func (mm *Model) ReplaceOne(ctx context.Context, key string, filter, replacement interface{}, ...) (*mongo.UpdateResult, error) + func (mm *Model) ReplaceOneNoCache(ctx context.Context, filter, replacement interface{}, ...) (*mongo.UpdateResult, error) + func (mm *Model) SetCache(key string, v interface{}) error + func (mm *Model) UpdateByID(ctx context.Context, key string, id, update interface{}, ...) (*mongo.UpdateResult, error) + func (mm *Model) UpdateByIDNoCache(ctx context.Context, id, update interface{}, opts ...*mopt.UpdateOptions) (*mongo.UpdateResult, error) + func (mm *Model) UpdateMany(ctx context.Context, keys []string, filter, update interface{}, ...) (*mongo.UpdateResult, error) + func (mm *Model) UpdateManyNoCache(ctx context.Context, filter, update interface{}, opts ...*mopt.UpdateOptions) (*mongo.UpdateResult, error) + func (mm *Model) UpdateOne(ctx context.Context, key string, filter, update interface{}, ...) (*mongo.UpdateResult, error) + func (mm *Model) UpdateOneNoCache(ctx context.Context, filter, update interface{}, opts ...*mopt.UpdateOptions) (*mongo.UpdateResult, error)