mongodb

package
v0.0.0-...-1d89dbf Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MGO_ADDRESSES          = "localhost:27018"
	MGO_REPLICATE_SET_NAME = ""

	MGO_DATABASE = "DoubanBookApi"
	MGO_USERNAME = "docker"
	MGO_PASSWORD = "docker"
)

Variables

This section is empty.

Functions

func Count

func Count(dbName string, colName string, selector bson.M) (int, error)

func ExistsCollection

func ExistsCollection(dbName string, colName string) (bool, error)

func ExistsDabatase

func ExistsDabatase(dbName string) (bool, error)

func FindAll

func FindAll(dbName string, colName string, selector bson.M, typ reflect.Type) ([]interface{}, error)

func FindId

func FindId(dbName string, colName string, id interface{}) (interface{}, error)

func FindList

func FindList(dbName string, colName string, selector bson.M, typ reflect.Type, skip int, limit int) ([]interface{}, int64, error)

func FindOne

func FindOne(dbName string, colName string, selector bson.M) (interface{}, error)

func Insert

func Insert(dbName string, colName string, data interface{}) error

func MustFindAll

func MustFindAll(dbName string, colName string, selector bson.M, typ reflect.Type) []interface{}

func MustFindList

func MustFindList(dbName string, colName string, selector bson.M, typ reflect.Type, skip int, limit int) ([]interface{}, int64)

func MustFindOne

func MustFindOne(dbName string, colName string, selector bson.M) interface{}

func Ping

func Ping() error

func Remove

func Remove(dbName string, colName string, selector bson.M) error

func RemoveAll

func RemoveAll(dbName string, colName string, selector bson.M) (*mgo.ChangeInfo, error)

func RemoveId

func RemoveId(dbName string, colName string, id interface{}) error

func Update

func Update(dbName string, colName string, selector bson.M, data interface{}) error

func UpdateId

func UpdateId(dbName string, colName string, id interface{}, data interface{}) error

func Upsert

func Upsert(dbName string, colName string, selector bson.M, data interface{}) (*mgo.ChangeInfo, error)

func UpsertId

func UpsertId(dbName string, colName string, id interface{}, data interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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