Versions in this module Expand all Collapse all v2 v2.1.0 Sep 3, 2025 v2.0.0 Aug 17, 2025 Changes in this version + var ErrNoCollectionSet = errors.New("no collection set") + type Connector interface + Aggregate func(pipeline interface{}, opts ...options.Lister[options.AggregateOptions]) (cur *mongo.Cursor, err error) + Collection func(coll string, opts ...options.Lister[options.CollectionOptions]) *mongo.Collection + Count func(filter interface{}, opts ...options.Lister[options.CountOptions]) (cnt int64, err error) + CreateIndex func(model mongo.IndexModel, opts ...options.Lister[options.CreateIndexesOptions]) (string, error) + CreateSearchIndex func(model mongo.SearchIndexModel, ...) (string, error) + Database func() *mongo.Database + Decode func(cur *mongo.Cursor, val interface{}) error + DeleteMany func(filter interface{}, opts ...options.Lister[options.DeleteManyOptions]) (res *mongo.DeleteResult, err error) + DeleteOne func(filter interface{}, opts ...options.Lister[options.DeleteOneOptions]) (res *mongo.DeleteResult, err error) + Distinct func(fieldName string, filter interface{}, ...) (res *mongo.DistinctResult, err error) + Drop func() error + FetchAll func(cur *mongo.Cursor, results interface{}) error + Find func(filter interface{}, opts ...options.Lister[options.FindOptions]) (*mongo.Cursor, error) + FindOne func(filter interface{}, opts ...options.Lister[options.FindOneOptions]) *mongo.SingleResult + FindOneAndDelete func(filter interface{}, opts ...options.Lister[options.FindOneAndDeleteOptions]) *mongo.SingleResult + FindOneAndReplace func(filter interface{}, replacement interface{}, ...) *mongo.SingleResult + FindOneAndUpdate func(filter interface{}, update interface{}, ...) *mongo.SingleResult + GetNextSeq func(name string, opts ...string) (res int64, err error) + Indexes func() (*mongo.IndexView, error) + InsertMany func(document []interface{}, opts ...options.Lister[options.InsertManyOptions]) (res *mongo.InsertManyResult, err error) + InsertOne func(document interface{}, opts ...options.Lister[options.InsertOneOptions]) (res *mongo.InsertOneResult, err error) + NewGridfsBucket func() (*mongo.GridFSBucket, error) + Next func(cur *mongo.Cursor) bool + ReplaceOne func(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + SearchIndexes func() (*mongo.SearchIndexView, error) + UpdateById func(id interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + UpdateMany func(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + UpdateOne func(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + Watch func(pipeline interface{}, opts ...options.Lister[options.ChangeStreamOptions]) (stream *mongo.ChangeStream, err error) + WithCollection func(coll string, opts ...options.Lister[options.CollectionOptions]) Connector + WithContext func(context.Context) Connector + type NewParams struct + Database string + Uri string + type StdConnector struct + func NewConnector(params NewParams) (*StdConnector, error) + func (conn *StdConnector) Aggregate(pipeline interface{}, opts ...options.Lister[options.AggregateOptions]) (cur *mongo.Cursor, err error) + func (conn *StdConnector) Collection(coll string, opts ...options.Lister[options.CollectionOptions]) *mongo.Collection + func (conn *StdConnector) Count(filter interface{}, opts ...options.Lister[options.CountOptions]) (cnt int64, err error) + func (conn *StdConnector) CreateIndex(model mongo.IndexModel, opts ...options.Lister[options.CreateIndexesOptions]) (string, error) + func (conn *StdConnector) CreateSearchIndex(model mongo.SearchIndexModel, ...) (string, error) + func (conn *StdConnector) Database() *mongo.Database + func (conn *StdConnector) Decode(cur *mongo.Cursor, val interface{}) error + func (conn *StdConnector) DeleteMany(filter interface{}, opts ...options.Lister[options.DeleteManyOptions]) (res *mongo.DeleteResult, err error) + func (conn *StdConnector) DeleteOne(filter interface{}, opts ...options.Lister[options.DeleteOneOptions]) (res *mongo.DeleteResult, err error) + func (conn *StdConnector) Distinct(fieldName string, filter interface{}, ...) (res *mongo.DistinctResult, err error) + func (conn *StdConnector) Drop() (err error) + func (conn *StdConnector) FetchAll(cur *mongo.Cursor, results interface{}) (err error) + func (conn *StdConnector) Find(filter interface{}, opts ...options.Lister[options.FindOptions]) (cur *mongo.Cursor, err error) + func (conn *StdConnector) FindOne(filter interface{}, opts ...options.Lister[options.FindOneOptions]) (res *mongo.SingleResult) + func (conn *StdConnector) FindOneAndDelete(filter interface{}, opts ...options.Lister[options.FindOneAndDeleteOptions]) (cur *mongo.SingleResult) + func (conn *StdConnector) FindOneAndReplace(filter interface{}, replacement interface{}, ...) (cur *mongo.SingleResult) + func (conn *StdConnector) FindOneAndUpdate(filter interface{}, update interface{}, ...) (cur *mongo.SingleResult) + func (conn *StdConnector) GetNextSeq(name string, opts ...string) (seq int64, err error) + func (conn *StdConnector) Indexes() (*mongo.IndexView, error) + func (conn *StdConnector) InsertMany(document []interface{}, opts ...options.Lister[options.InsertManyOptions]) (res *mongo.InsertManyResult, err error) + func (conn *StdConnector) InsertOne(document interface{}, opts ...options.Lister[options.InsertOneOptions]) (res *mongo.InsertOneResult, err error) + func (conn *StdConnector) NewGridfsBucket() (*mongo.GridFSBucket, error) + func (conn *StdConnector) Next(cur *mongo.Cursor) bool + func (conn *StdConnector) ReplaceOne(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + func (conn *StdConnector) SearchIndexes() (*mongo.SearchIndexView, error) + func (conn *StdConnector) UpdateById(id interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + func (conn *StdConnector) UpdateMany(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + func (conn *StdConnector) UpdateOne(filter interface{}, update interface{}, ...) (res *mongo.UpdateResult, err error) + func (conn *StdConnector) Watch(pipeline interface{}, opts ...options.Lister[options.ChangeStreamOptions]) (stream *mongo.ChangeStream, err error) + func (conn *StdConnector) WithCollection(coll string, opts ...options.Lister[options.CollectionOptions]) Connector + func (conn *StdConnector) WithContext(ctx context.Context) Connector Other modules containing this package github.com/mbretter/go-mongodb