package
0.0.0-20180330192724-a09253046f73
Repository: https://github.com/metaleap/go-util.git
Documentation: pkg.go.dev

# README

umgo

Go programming helpers for common MongoDB needs.

Usage

func ConnectTo

func ConnectTo(url string, safe bool) (conn *mgo.Session, err error)

Short-hand for mgo.Dial then Session.SetSafe.

func ConnectUrl

func ConnectUrl(host string, port int, direct bool) (url string)

Returns a connection URL for ConnectTo.

func Sparse

func Sparse(m bson.M) bson.M

Deletes all zero-value and empty-key entries from m, then returns m.