db

package
v0.0.0-...-b1ea8ad Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMgo

func InitMgo(c *conf.MgoConfig) error

Types

type Mdb

type Mdb struct {
	*conf.MgoConfig
	*mgo.Session
}

func GetDB

func GetDB() *Mdb

func (*Mdb) FindId

func (self *Mdb) FindId(collection string, id interface{}, result interface{}) error

func (*Mdb) FindOne

func (self *Mdb) FindOne(collection string, query interface{}, result interface{}) error

func (*Mdb) Insert

func (self *Mdb) Insert(collection string, data ...interface{}) error

func (*Mdb) RemoveId

func (self *Mdb) RemoveId(collection string, id interface{}) error

func (*Mdb) Upsert

func (self *Mdb) Upsert(collection string, selector interface{}, change interface{}) error

func (*Mdb) WithC

func (m *Mdb) WithC(collection string, job func(*mgo.Collection) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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