mongo

package
v7.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 12 Imported by: 0

README

Useful tools around MongoDB

mongo.DefaultDatabaseName = "default-database"
mongo.Session(logger.Default())

Create a new session based on MONGO_URL, connection will be initialized only once, so you can call it everytime your need a session.

Will wait until database is available.

If no MONGO_URL is defined, will use mongodb://localhost:27017/ + DefaultDatabaseName

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDatabaseName string
)

Functions

func BuildSession

func BuildSession(ctx context.Context, rawURL string) (*mgo.Session, error)

func Session

func Session(log logrus.FieldLogger) *mgo.Session

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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