mongoutil

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 4 Imported by: 0

README

mongoutil - MongoDB utilities for GO

Test GoDoc Version

GO utility packages for simpler interactions with MongoDB.

Documentation

Install

go get github.com/bounoable/mongoutil

Packages

Documentation

Overview

Package mongoutil provides conventient helper functions for interactions with MongoDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, opts ...*options.ClientOptions) (*mongo.Client, error)

Connect connects to MongoDB. If both MONGO_USER and MONGO_PASSWORD environment variables are set, the credentials are passed added to the client options.

func ConnectDB

func ConnectDB(ctx context.Context, db string, opts ...*options.ClientOptions) (*mongo.Database, error)

ConnectDB connects to a specific database. If both MONGO_USER and MONGO_PASSWORD environment variables are set, the credentials are passed added to the client options.

Types

This section is empty.

Directories

Path Synopsis
Package index provides functions to create MongoDB indexes from YAML configuration files.
Package index provides functions to create MongoDB indexes from YAML configuration files.

Jump to

Keyboard shortcuts

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