mgom

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: GPL-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MgoAggregate

type MgoAggregate interface {
	GetPipeLine(q bson.M) mongo.Pipeline
	GetC() string
}

type MgoDBModel

type MgoDBModel interface {
	DisableCheckBeforeSave(b bool)
	SetDB(db *mongo.Database)
	Save(d dao.DocInter, u dao.LogUser) (interface{}, error)
	BatchSave(doclist []dao.DocInter, u dao.LogUser) (inserted []interface{}, failed []dao.DocInter, err error)
	FindById(d dao.DocInter) error
	FindOne(d dao.DocInter, q bson.M, option ...*options.FindOneOptions) error
	Find(d dao.DocInter, q bson.M, option ...*options.FindOptions) (interface{}, error)
	FindAndExec(d dao.DocInter, q bson.M, exec func(i interface{}) error, opts ...*options.FindOptions) error
	PipeFindOne(aggr MgoAggregate, filter bson.M) error
	PipeFind(aggr MgoAggregate, filter bson.M, opts ...*options.AggregateOptions) (interface{}, error)
	PipeFindAndExec(aggr MgoAggregate, q bson.M, exec func(i interface{}) error, opts ...*options.AggregateOptions) error
	UpdateOne(d dao.DocInter, field bson.D, u dao.LogUser) (int64, error)
	UpdateAll(d dao.DocInter, q bson.M, field bson.D, u dao.LogUser) (int64, error)
	RemoveByID(d dao.DocInter, u dao.LogUser) (int64, error)
	RemoveAll(d dao.DocInter, q bson.M, u dao.LogUser) (int64, error)
}

func NewMgoModel

func NewMgoModel(ctx context.Context, db *mongo.Database, log log.Logger) MgoDBModel

Jump to

Keyboard shortcuts

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