mgdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MgoDB

type MgoDB struct {
	*mgo.Database
	Prefix string
}

MgoDB mongodb

func New

func New(db *mgo.Database, prefix string) MgoDB

New 创建新的mgdb对象

func (MgoDB) Coll

func (mgodb MgoDB) Coll(table string) *mgo.Collection

Coll 获取collection对象。

func (MgoDB) LimitQuery

func (mgodb MgoDB) LimitQuery(mgocoll string, key interface{}, result interface{}, pageSize, pageNo int, selector vmap.V) (int, error)

LimitQuery 查询可管理的内容。屏蔽status为-1000和-2000的内容

func (MgoDB) LimitUpdate

func (mgodb MgoDB) LimitUpdate(mgocoll string, skey, data vmap.V) error

LimitUpdate 重新封装的mongodb的Update,屏蔽了对指定status的更新

func (MgoDB) Query

func (mgodb MgoDB) Query(mgocoll string, key interface{}, result interface{}, pageSize, pageNo int, selector vmap.V) (int, error)

Query 搜索mongodb

Jump to

Keyboard shortcuts

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