Documentation
¶
Index ¶
- func AsyncFind[T any](coll string, filter any, fn func([]*T, error), opts ...*options.FindOptions)
- func AsyncFindOne[T any](coll string, filter any, fn func(*T, error), opts ...*options.FindOneOptions)
- func AsyncFindOneAndUpdate[T any](coll string, filter, update any, fn func(*T, error), ...)
- 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 Find[T any](coll string, filter any, items *[]*T, opts ...*options.FindOptions) error
- 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 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsyncFindOne ¶
func AsyncFindOneAndUpdate ¶
func AsyncUpdateOne ¶
func AsyncUpdateOne(coll string, filter, update any, fn func(*mongo.UpdateResult, error), opts ...*options.UpdateOptions)
func Coll ¶
func Coll(coll string) *mongo.Collection
func Conn ¶
func Conn(db string, clientOpt *options.ClientOptions, dbOpt *options.DatabaseOptions) *util.Err
func DelOne ¶
func DelOne(coll string, filter any, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func FindOneAndDel ¶
func FindOneAndUpdate ¶
func FindWithTotal ¶
func InitColl ¶
func InitColl(coll string, idxModel func() []mongo.IndexModel, opts ...*options.CollectionOptions)
func InsertMany ¶
func InsertMany(coll string, items []any, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
func InsertOne ¶
func InsertOne(coll string, item any, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
func ReplaceOne ¶
func ReplaceOne(coll string, filter, replacement any, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
func Tx ¶
func Tx(sessionOpt *options.SessionOptions, txOpt *options.TransactionOptions, fn util.ToErr) *util.Err
func UpdateMany ¶
func UpdateMany(coll string, filter, update any, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func UpdateOne ¶
func UpdateOne(coll string, filter, update any, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.