Documentation ¶
Index ¶
- func CloseMongoClient()
- func Count(database string, collection string, filter interface{}) (int64, error)
- func ExpireTime(database string, collection string, seconds int) error
- func FindOne(database string, collection string, filter, result interface{}) error
- func FindPage(database string, collection string, skip, limit int64, ...) error
- func GetMongoClient() *mongo.Client
- func InitMongoClient(urlMongo, user, password string) error
- func Insert(database string, collection string, doc interface{}) error
- func InsertExpire(database string, collection string, doc interface{}, seconds int) error
- func InsertMany(database string, collection string, docs ...interface{}) error
- func Remove(database string, collection string, filter interface{}) error
- func RemoveMany(database string, collection string, filter interface{}) error
- func TimeoutContext() context.Context
- func Update(database string, collection string, filter, update interface{}) error
- func UpdateMany(database string, collection string, filter, update interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseMongoClient ¶
func CloseMongoClient()
func ExpireTime ¶
设置失效时间 一般不通过代码设置
func FindPage ¶
func FindPage(database string, collection string, skip, limit int64, filter, sort, result interface{}) error
分页查询
func GetMongoClient ¶
func InsertExpire ¶
添加一条记录设置失效时间
func InsertMany ¶
添加多条记录
func RemoveMany ¶
删除多条记录
func TimeoutContext ¶
func UpdateMany ¶
更新多条记录
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.