mongo

package
v0.0.0-...-7206171 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDb string

Functions

func GetDb

func GetDb() string

func Init

func Init(cfg *config.MongoDbConfig) bool

func MAdd

func MAdd(db, collection string, dest interface{}) bool

MAdd 插入数据

func MCount

func MCount(db, collection string, selector bson.M) uint64

MCount 查找数据数量

func MFindList

func MFindList(db, collection string, selector bson.M, destList interface{}) bool

MFindList 查找数据列表

func MFindOne

func MFindOne(db, collection string, selector bson.M, dest interface{}) bool

MFindOne 查找一个数据

func MFindPageList

func MFindPageList(db, collection string, skip, limit int, selector bson.M, destList interface{}, sort ...string) bool

MFindPageList 分页查找数据列表

func MFindSortPageList

func MFindSortPageList(db, collection string, skip, limit int, selector bson.M, destList interface{}, sort ...string) bool

MFindSortPageList 分页查找数据列表

func MRemove

func MRemove(db, collection string, selector bson.M) bool

MRemove 删除数据

func MSave

func MSave(db, collection string, selector, update bson.M) bool

MSave 更新数据

func MUpdate

func MUpdate(db, collection string, selector, update bson.M) bool

MUpdate 更新数据

func Release

func Release()

Types

type DbDaoMongoSupport

type DbDaoMongoSupport struct {
}

func (DbDaoMongoSupport) CountList

func (db DbDaoMongoSupport) CountList(query interface{}) uint64

func (DbDaoMongoSupport) DelData

func (db DbDaoMongoSupport) DelData(query interface{}) int64

func (DbDaoMongoSupport) InsertOne

func (db DbDaoMongoSupport) InsertOne(dest interface{}) int64

func (DbDaoMongoSupport) SelectList

func (db DbDaoMongoSupport) SelectList(query interface{}, skip, limit int, sort ...string) interface{}

func (DbDaoMongoSupport) SelectOne

func (db DbDaoMongoSupport) SelectOne(query interface{}) interface{}

func (DbDaoMongoSupport) UpdateList

func (db DbDaoMongoSupport) UpdateList(query interface{}, update interface{}) int64

func (DbDaoMongoSupport) UpdateOne

func (db DbDaoMongoSupport) UpdateOne(dest interface{}) int64

type MgServerConfig

type MgServerConfig struct {
	Name        string
	Hosts       string
	AuthDb      string
	AuthUser    string
	AuthPass    string
	MaxPoolSize int
}

type Query

type Query struct {
	Key string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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