mong

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractId

func ExtractId(doc bson.Raw) primitive.E

func GetCollectionStats added in v0.0.13

func GetCollectionStats(r *Mong, database, collection string) (uint64, error)

func IsDuplicateKeyError

func IsDuplicateKeyError(err error) bool

IsDuplicateKeyError checks if the error is a duplicate key error

func ListCollections

func ListCollections(ctx context.Context, db string, mongo *Mong) ([]string, error)

List the collections of a database

func ListDbCollections added in v0.0.13

func ListDbCollections(ctx context.Context, databases []string) (map[string][]string, error)

Types

type Mong

type Mong struct {
	// Keep the connection/client
	Client *mongo.Client
}

func NewMongo

func NewMongo(connectUri string) *Mong

NewMongo returns a new Mongo struct

type MongoRegistry

type MongoRegistry struct {
	// contains filtered or unexported fields
}
var Registry *MongoRegistry = nil

func NewMongoRegistry

func NewMongoRegistry(appConfig *config.AppConfig) *MongoRegistry

func (*MongoRegistry) GetSource

func (m *MongoRegistry) GetSource() *Mong

func (*MongoRegistry) GetTarget

func (m *MongoRegistry) GetTarget() *Mong

Jump to

Keyboard shortcuts

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