umgo

package
v0.0.0-...-76c535a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 4 Imported by: 0

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.

Documentation

Overview

Go programming helpers for common MongoDB needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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