Versions in this module Expand all Collapse all v0 v0.0.1 Mar 12, 2024 Changes in this version + func AsyncFindOneAndUpdate[T any](coll string, filter, update any, fn func(*T, error), ...) + func AsyncFindOne[T any](coll string, filter any, fn func(*T, error), opts ...*options.FindOneOptions) + func AsyncFind[T any](coll string, filter any, fn func([]*T, error), opts ...*options.FindOptions) + func AsyncUpdateOne(coll string, filter, update any, fn func(*mongo.UpdateResult, error), ...) + func BuildProjectionD(d *bson.D, exclude []string, keys ...string) + func CheckColl() *util.Err + func Client() *mongo.Client + func Coll(coll string) *mongo.Collection + func Conn(db string, clientOpt *options.ClientOptions, dbOpt *options.DatabaseOptions) *util.Err + func CountDoc(coll string, filter any, opts ...*options.CountOptions) (int64, error) + func Db() *mongo.Database + func DelMany(coll string, filter any, opts ...*options.DeleteOptions) (int64, *util.Err) + func DelOne(coll string, filter any, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) + func DisConn() + func FindOne(coll string, filter any, item any, opts ...*options.FindOneOptions) error + func FindOneAndDel(coll string, filter any, item any, opts ...*options.FindOneAndDeleteOptions) error + func FindOneAndUpdate(coll string, filter, update any, item any, ...) error + func FindWithTotal[T any](coll string, filter any, fn func(int64, []*T, error), ...) + func Find[T any](coll string, filter any, items *[]*T, opts ...*options.FindOptions) error + func InitColl(coll string, idxModel func() []mongo.IndexModel, ...) + func InsertMany(coll string, items []any, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error) + func InsertOne(coll string, item any, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error) + func ReplaceOne(coll string, filter, replacement any, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error) + func Tx(sessionOpt *options.SessionOptions, txOpt *options.TransactionOptions, ...) *util.Err + func UpdateMany(coll string, filter, update any, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error) + func UpdateOne(coll string, filter, update any, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)