mongodb

package
v0.0.0-...-4290112 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBService

type DBService struct {
	Client mongo.Client
	//Ctx    context.Context
	Cancel context.CancelFunc
	Err    error
}

func NewDBService

func NewDBService(dburi string) *DBService

func (*DBService) FindAll

func (db *DBService) FindAll(ctx context.Context, dataBase string, col string, filter interface{}) *string

func (*DBService) FindOne

func (db *DBService) FindOne(ctx context.Context, dataBase string, col string, filter interface{}) *mongo.SingleResult

func (*DBService) Insertone

func (db *DBService) Insertone(ctx context.Context, dataBase string, col string, doc interface{}) *service.InsertOneResult

func (*DBService) Pingdb

func (db *DBService) Pingdb(ctx context.Context) error

This is a user defined method that accepts mongo.Client and context.Context This method used to ping the mongoDB, return error if any.

type FindAllResult

type FindAllResult struct {
}

Jump to

Keyboard shortcuts

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