db

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

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Ctx    context.Context
	Client *mongo.Client
	DB     *mongo.Database
}

func NewConnection

func NewConnection(ctx context.Context, uri, dbName string) (Connection, error)

func (*Connection) GetCollection

func (c *Connection) GetCollection(collName string) *mongo.Collection

func (*Connection) GetCollectionNames

func (c *Connection) GetCollectionNames(filter interface{}) ([]string, error)

func (*Connection) GetDatabaseNames

func (c *Connection) GetDatabaseNames(filter interface{}) ([]string, error)

func (*Connection) NewCollection

func (c *Connection) NewCollection(collName string) (*mongo.Collection, error)

Jump to

Keyboard shortcuts

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