mongo

package
v0.0.0-...-4d2b9a0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 5 Imported by: 0

README

Instalação de ferramentas (GNU/Linux) :

  1. Obter MongoDB :

Seguir etapas conforme documentação oficial

Iniciar serviço mongod :

sudo systemctl start mongod
  1. Criar banco de dados MongoDB
use crud_dao
  1. Executar ping para testar avaliabilidade da aplicação
curl -i -XGET -H "Content-Type:application/json" http://localhost:8181/ping

Documentation

Index

Constants

View Source
const (
	Schema   = "MONGODB_SCHEMA"
	Uri      = "MONGODB_URI"
	Username = "MONGODB_USERNAME"
	Password = "MONGODB_PASSWORD"

	Options = "MONGODB_OPTIONS"
)

Variables

View Source
var (
	CollectionOnce sync.Once

	ConnectionTimeout = time.Duration(connectionTimeout, 2*time.Minute)
)
View Source
var (
	MgoDb = "databaseHere"

	CollectionName = "Clientes"
)

Functions

func Connect

func Connect() *mongo.Client

func GetCollectionClientes

func GetCollectionClientes() *mongo.Collection

Types

This section is empty.

Jump to

Keyboard shortcuts

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