mongo

package
v0.0.0-...-20e2382 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conn

func Conn() *mgo.Session

Get a connection from the session

func ConvertObjectIds

func ConvertObjectIds(query map[string]interface{})

func GetAll

func GetAll(c *mgo.Collection,
	query map[string]interface{},
	fields []string,
	sortBy []string,
	offset int,
	limit int,
	result interface{}) (err error)

GetAll retrieves all records matches certain condition. Returns empty list if no records exist

func Init

func Init(url string, debugLog *log.Logger)

Dial up to mongo using the "mongodb-url" from the app.conf First checks for environent variable GOAX_MONGODB_URL

func ToBsonMap

func ToBsonMap(fields ...string) (selBson bson.M)

Makes a bson map out of a list of fields

Types

This section is empty.

Jump to

Keyboard shortcuts

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