Versions in this module Expand all Collapse all v1 v1.0.5 May 16, 2024 Changes in this version + func MustUpdater(m any) *updater + func NewWGM(connectionUri string, databaseName string) error v1.0.4 Jan 10, 2024 Changes in this version + var FindPageOptionSyncPool = sync.Pool + func Aggregate(m IDefaultModel, pipeline any, result any) error + func CloseAll() + func Col(name string) *qmgo.Collection + func Ctx() context.Context + func Delete(m IDefaultModel) error + func Distinct(m IDefaultModel, filter any, field string, result any) error + func ExistInDB(m IDefaultModel, filter any) bool + func FindById(colName string, id string, res any) (bool, error) + func FindOne(m IDefaultModel, filter map[string]any) (hasResult bool) + func FindPage(m IDefaultModel, filter any, res any, pageSize int64, currentPage int64) (totalDoc int64, totalPage int64) + func FindPageWithOption(m IDefaultModel, filter any, res any, pageSize int64, currentPage int64, ...) (totalDoc int64, totalPage int64) + func InitWgm(connectionUri string, databaseName string) error + func Insert(m IDefaultModel) (*qmgo.InsertOneResult, error) + func IsNoResult(err error) bool + func MustHexToObjectId(strId string) primitive.ObjectID + func Ping() error + func Update(m IDefaultModel, filter ...map[string]any) error + func Updater(m any) *updater + type DefaultModel struct + CreateTime int64 + Id primitive.ObjectID + LastModifyTime int64 + func (m *DefaultModel) BeforeInsert(ctx context.Context) error + func (m *DefaultModel) BeforeUpdate(ctx context.Context) error + func (m *DefaultModel) BeforeUpsert(ctx context.Context) error + func (m *DefaultModel) ColName() string + func (m *DefaultModel) GetId() string + func (m *DefaultModel) GetObjectID() primitive.ObjectID + func (m *DefaultModel) PutId(id string) + type FindPageOption struct + func NewFindPageOption() *FindPageOption + func (o *FindPageOption) SetSelectField(bson interface{}) *FindPageOption + func (o *FindPageOption) SetSortField(field ...string) *FindPageOption + type IDefaultModel interface + ColName func() string + GetId func() string + GetObjectID func() primitive.ObjectID + PutId func(id string)