helper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgFindFailed    = "find failed, deadline exceeded"
	FmtErrFindFailed = "can not find in %ss"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) Aggregate

func (r *Service) Aggregate(ctx context.Context, collname string, pipeline []map[string]interface{}, result interface{}) error

func (*Service) CountDocuments

func (r *Service) CountDocuments(ctx context.Context, collname string, filter map[string]interface{}) (int64, error)

func (*Service) CreateMany

func (r *Service) CreateMany(ctx context.Context, collname string, recs ...interface{}) error

func (*Service) CreateOne

func (r *Service) CreateOne(ctx context.Context, collname string, rec interface{}) error

func (*Service) FindOne

func (r *Service) FindOne(ctx context.Context, collname string, value interface{}, options ...abstr.FindOption) error

func (*Service) FindOneAndDelete

func (r *Service) FindOneAndDelete(ctx context.Context, collname string, filter map[string]interface{}, value interface{}, options ...abstr.FindOption) error

func (*Service) List

func (r *Service) List(ctx context.Context, collname string, recs interface{}, options ...abstr.FindOption) (*abstr.Page, error)

func (*Service) Pull

func (r *Service) Pull(ctx context.Context, collname string, filter map[string]interface{}, value interface{}) error

func (*Service) RemoveMany

func (r *Service) RemoveMany(ctx context.Context, collname string, filter map[string]interface{}) error

func (*Service) Unmark

func (r *Service) Unmark(ctx context.Context, collname string, filter map[string]interface{}, value interface{}) error

func (*Service) UpdateMany

func (r *Service) UpdateMany(ctx context.Context, collname string, filter interface{}, value interface{}) (*mongo.UpdateResult, error)

func (*Service) UpdateOne

func (r *Service) UpdateOne(ctx context.Context, collname string, filter map[string]interface{}, value interface{}, options ...abstr.FindOption) error

func (*Service) UpdateOneMore

func (r *Service) UpdateOneMore(ctx context.Context, collname string, filter map[string]interface{}, value interface{}, options ...abstr.FindOption) error

UpdateOneMore 允许在外部使用 $set 之外的操作符

Jump to

Keyboard shortcuts

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