database

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoFactory

type MongoFactory struct {
	Client   *mongo.Client
	Database *mongo.Database
	Context  *executioncontext.Context
}

MongoFactory MongoFactory Entity

func NewFactory

func NewFactory() MongoFactory

NewFactory Instantiate a new MongoDb Factory

func (*MongoFactory) Find

func (f *MongoFactory) Find(collectionName string, filter bson.D) []*bson.M

Find Finds documents in the database

func (*MongoFactory) GetClient

func (f *MongoFactory) GetClient() *mongo.Client

GetClient returns mongodb client

func (*MongoFactory) GetContext

func (f *MongoFactory) GetContext() *executioncontext.Context

GetContext Gets the Execution context

func (*MongoFactory) GetDatabase

func (f *MongoFactory) GetDatabase() *mongo.Database

GetDatabase returns MongoDb database

func (*MongoFactory) InsertMany

func (f *MongoFactory) InsertMany(collectionName string, elements []interface{}) *mongo.InsertManyResult

InsertMany Inserts one document into the selected collection

func (*MongoFactory) InsertOne

func (f *MongoFactory) InsertOne(collectionName string, element interface{}) *mongo.InsertOneResult

InsertOne Inserts one document into the selected collection

Jump to

Keyboard shortcuts

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