Documentation ¶
Index ¶
- func Create(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) error
- func CreateWithID(ctx context.Context, collection *mongo.Collection, id interface{}, ...) error
- func Delete(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) (int64, error)
- func Get(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) error
- func GetList(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) error
- func Insert(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) error
- func UpdateMany(ctx context.Context, collection *mongo.Collection, filter interface{}, ...) (int64, error)
- func UpdateWithID(ctx context.Context, collection *mongo.Collection, identity interface{}, ...) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, collection *mongo.Collection, filter interface{}, data interface{}) error
Create get one for mongo
func CreateWithID ¶
func CreateWithID(ctx context.Context, collection *mongo.Collection, id interface{}, data interface{}) error
CreateWithID create with id req
func Delete ¶
func Delete(ctx context.Context, collection *mongo.Collection, filter interface{}, ops ...*options.DeleteOptions) (int64, error)
Delete get one for mongo
func Get ¶
func Get(ctx context.Context, collection *mongo.Collection, filter interface{}, result interface{}, ops ...*options.FindOneOptions) error
Get get one for mongo
func GetList ¶
func GetList(ctx context.Context, collection *mongo.Collection, filter interface{}, lists interface{}, ops ...*options.FindOptions) error
GetList get list for mongo
func Insert ¶
func Insert(ctx context.Context, collection *mongo.Collection, filter interface{}, data interface{}) error
Insert get one for mongo
func UpdateMany ¶
func UpdateMany(ctx context.Context, collection *mongo.Collection, filter interface{}, data interface{}, controlMap map[string]bool, opts ...*options.UpdateOptions) (int64, error)
UpdateMany Update it auto
func UpdateWithID ¶
func UpdateWithID(ctx context.Context, collection *mongo.Collection, identity interface{}, data interface{}, controlMap map[string]bool, opts ...*options.UpdateOptions) (int64, error)
UpdateWithID Update it auto
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.