mongodb

package
v0.0.0-...-443ed56 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionFilter

func CollectionFilter(collections []string, collectionsExclude []string) bson.D

Types

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

func NewMongoDB

func NewMongoDB(username string, password string, host string, port uint, dbName string, isSRV bool) *MongoDB

func (*MongoDB) Close

func (m *MongoDB) Close()

func (*MongoDB) Connect

func (m *MongoDB) Connect() error

func (*MongoDB) CreateCollection

func (m *MongoDB) CreateCollection(collection string) error

func (*MongoDB) DropCollection

func (m *MongoDB) DropCollection(collection string) error

func (*MongoDB) DumpDocumentsBatch

func (m *MongoDB) DumpDocumentsBatch(collection string, batchSize int64) error

func (*MongoDB) FetchAllDocuments

func (m *MongoDB) FetchAllDocuments(collection string) ([]bson.D, error)

func (*MongoDB) FetchCollections

func (m *MongoDB) FetchCollections(filter interface{}) ([]string, error)

func (*MongoDB) FetchTotalDocumentsCount

func (m *MongoDB) FetchTotalDocumentsCount(collection string, filter interface{}) (int64, error)

func (*MongoDB) GetURI

func (m *MongoDB) GetURI() string

func (*MongoDB) InsertDocuments

func (m *MongoDB) InsertDocuments(collection string, documents []interface{}) error

func (*MongoDB) Ping

func (m *MongoDB) Ping() error

Jump to

Keyboard shortcuts

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