Versions in this module Expand all Collapse all v1 v1.0.1 Feb 6, 2024 v1.0.0 Jan 19, 2024 Changes in this version + func GetObjectID(id interface{}) (primitive.ObjectID, error) + type Collection interface + GetC func() string + type CommonDoc struct + Records []*Record + func (c *CommonDoc) AddRecord(u LogUser, msg string) []*Record + func (c *CommonDoc) SetCreator(lu LogUser) + func (u *CommonDoc) GetC() string + type DocInter interface + AddRecord func(u LogUser, msg string) []*Record + GetDoc func() interface{} + GetID func() interface{} + GetIndexes func() []mongo.IndexModel + SetCreator func(u LogUser) + type ListDoc interface + BeforeSave func() error + GetC func() string + GetID func() string + GetList func(slice interface{}) []ListDoc + type LogUser interface + GetAccount func() string + GetName func() string + type MgoAggregate interface + GetPipeline func(q bson.M) mongo.Pipeline + type MgoDBModel interface + BatchSave func(doclist []DocInter, u LogUser) (inserted []interface{}, failed []DocInter, err error) + BatchUpdate func(doclist []DocInter, getField func(d DocInter) bson.D, u LogUser) (failed []DocInter, err error) + CountAggrDocuments func(aggr MgoAggregate, q bson.M) (int64, error) + CountDocuments func(d Collection, q bson.M) (int64, error) + CreateCollection func(dlist ...DocInter) error + DisableCheckBeforeSave func(b bool) + Find func(d DocInter, q bson.M, option ...*options.FindOptions) (interface{}, error) + FindAndExec func(d DocInter, q bson.M, exec func(i interface{}) error, ...) error + FindByID func(d DocInter) error + FindOne func(d DocInter, q bson.M, option ...*options.FindOneOptions) error + GetPaginationSource func(d DocInter, q bson.M, opts ...*options.FindOptions) format.PaginationSource + GetPipeMatchPaginationSource func(aggr MgoAggregate, q bson.M, sort bson.M) format.PaginationSource + GetPipePaginationSource func(aggr MgoAggregate, q bson.M, sort bson.M) format.PaginationSource + NewFindMgoDS func(d DocInter, q bson.M, opts ...*options.FindOptions) MgoDS + NewPipeFindMgoDS func(d MgoAggregate, q bson.M, opts ...*options.AggregateOptions) MgoDS + PageFind func(d DocInter, q bson.M, limit, page int64, opts ...*options.FindOptions) (interface{}, error) + PagePipeFind func(aggr MgoAggregate, filter bson.M, sort bson.M, limit, page int64) (interface{}, error) + PipeFind func(aggr MgoAggregate, filter bson.M, opts ...*options.AggregateOptions) (interface{}, error) + PipeFindAndExec func(aggr MgoAggregate, q bson.M, exec func(i interface{}) error, ...) error + PipeFindOne func(aggr MgoAggregate, filter bson.M) error + RemoveAll func(d DocInter, q primitive.M, u LogUser) (int64, error) + RemoveByID func(d DocInter, u LogUser) (int64, error) + Save func(d DocInter, u LogUser) (interface{}, error) + SetDB func(db *mongo.Database) + UnsetFields func(d DocInter, q bson.M, fields []string, u LogUser) (int64, error) + UpdateAll func(d DocInter, q bson.M, fields bson.D, u LogUser) (int64, error) + UpdateOne func(d DocInter, fields bson.D, u LogUser) (int64, error) + Upsert func(d DocInter, u LogUser) (interface{}, error) + func NewMgoModel(ctx context.Context, db *mongo.Database) MgoDBModel + func NewMgoModelByReq(req *http.Request) MgoDBModel + type MgoDS interface + Exec func(exec func(i interface{}) error) error + ExportCSV func(w io.Writer, title []string, ...) error + type Record struct + Account string + Datetime time.Time + Name string + Summary string + func NewRecord(date time.Time, acc, name, msg string) *Record