helper

package
v0.0.0-...-9cc919f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL