repositories

package
v0.0.0-...-1e22bb6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Repo = &Repository{
	Client: ConnectDB(config.MongoURI()),
}

Functions

func ConnectDB

func ConnectDB(mongoURI string) *mongo.Client

Types

type Repository

type Repository struct {
	Client *mongo.Client
}

func (Repository) AddOne

func (r Repository) AddOne(collName string, doc interface{}) (*mongo.InsertOneResult, error)

func (Repository) FindOne

func (r Repository) FindOne(collName string, filter bson.D) *mongo.SingleResult

func (Repository) GetCollection

func (r Repository) GetCollection(collName string) *mongo.Collection

func (Repository) UpdateOne

func (r Repository) UpdateOne(collName string, filter bson.M, fields bson.M) bool

Jump to

Keyboard shortcuts

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