client

package
v0.0.0-...-fb1d941 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongDeleteOne

func MongDeleteOne(req *RequestMeta, selector interface{}) error

func MongInsertOne

func MongInsertOne(req *RequestMeta, docs interface{}) error

func MongUpsertOne

func MongUpsertOne(req *RequestMeta, selector interface{}, update interface{}) (*mgo.ChangeInfo, error)

func MongoEnsureIndex

func MongoEnsureIndex(req *RequestMeta, indexes []string) error

func MongoEnsureIndexWithExpire

func MongoEnsureIndexWithExpire(req *RequestMeta, indexes []string, afterTime time.Duration) error

func MongoNormalQuery

func MongoNormalQuery(req *RequestMeta, query *QueryMetaData, result interface{}) error

func MongoQueryCount

func MongoQueryCount(req *RequestMeta, query *QueryMetaData) (int, error)

func MongoQueryOne

func MongoQueryOne(req *RequestMeta, query *QueryMetaData, result interface{}) error

func MongoQueryOneNoCondition

func MongoQueryOneNoCondition(req *RequestMeta, result interface{}) error

Types

type QueryMetaData

type QueryMetaData struct {
	Condition bson.M
	Limit     int
	Skip      int
	Sort      []string
}

type RequestMeta

type RequestMeta struct {
	Sess       *mgo.Session
	DBName     string
	Collection string
}

Jump to

Keyboard shortcuts

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