Versions in this module Expand all Collapse all v1 v1.1.0 Nov 12, 2023 v1.0.0 Oct 17, 2023 Changes in this version + var DefaultDatabase string + type MongoDB struct + Collection string + CountPipeline []bson.M + Database string + Filter map[string]interface{} + Pipeline []bson.M + func (m *MongoDB) Aggregate(ctx context.Context, result interface{}, opts ...*options.AggregateOptions) error + func (m *MongoDB) AggregateByPage(ctx context.Context, countResult, result interface{}, ...) error + func (m *MongoDB) CountDocuments(ctx context.Context) (int64, error) + func (m *MongoDB) DeleteById(ctx context.Context, id interface{}) error + func (m *MongoDB) DeleteMany(ctx context.Context) (int64, error) + func (m *MongoDB) DeleteOne(ctx context.Context) (int64, error) + func (m *MongoDB) EstimatedDocumentCount(ctx context.Context) (int64, error) + func (m *MongoDB) Find(ctx context.Context, result interface{}, sortFields ...string) error + func (m *MongoDB) FindByPage(ctx context.Context, paging *Paging, result interface{}, sortFields ...string) (err error) + func (m *MongoDB) FindOne(ctx context.Context, result interface{}, sortFields ...string) error + func (m *MongoDB) InsertMany(ctx context.Context, documents []interface{}) ([]interface{}, error) + func (m *MongoDB) InsertOne(ctx context.Context, document interface{}) (interface{}, error) + func (m *MongoDB) UpdateById(ctx context.Context, id, update interface{}, opts ...*options.UpdateOptions) error + func (m *MongoDB) UpdateMany(ctx context.Context, update interface{}, opts ...*options.UpdateOptions) error + func (m *MongoDB) UpdateOne(ctx context.Context, update interface{}, opts ...*options.UpdateOptions) error + type Paging struct + EndNums int64 + Page int64 + PageCount int64 + PageSize int64 + StartNums int64 + Total int64 + func (p *Paging) GetPages() *Paging