mongodb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMongoDBClientUri

func GetMongoDBClientUri(reader config.Reader) string

Types

type MongoDBClient

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

func NewDatabaseClient

func NewDatabaseClient(configReader plugins.ConfigReader, logger *logs.Logger) MongoDBClient

func (*MongoDBClient) AddDocument

func (mongodbClient *MongoDBClient) AddDocument(databaseName, collectionName string, entry utils.Json) bool

func (*MongoDBClient) CheckConnectivity

func (mongodbClient *MongoDBClient) CheckConnectivity() bool

func (*MongoDBClient) ClearDatabaseCollections

func (mongodbClient *MongoDBClient) ClearDatabaseCollections(databaseName string, collectionNames ...string) error

func (*MongoDBClient) DeleteAll

func (mongodbClient *MongoDBClient) DeleteAll(databaseName, collectionName string, query utils.Json) bool

func (*MongoDBClient) FindALL

func (mongodbClient *MongoDBClient) FindALL(databaseName, collectionName string) error

func (*MongoDBClient) FindDocument

func (mongodbClient *MongoDBClient) FindDocument(databaseName, collectionName string, query utils.Json) (utils.Json, bool)

FindDocument looks for the given query in the database collection. It expects that exactly one document matches the query. If more than one document matches the query, the first document is returned and true is returned. If no document matches the query, the returned bool is set to false. If an error occurs, false is returned.

func (*MongoDBClient) FindDocuments

func (mongodbClient *MongoDBClient) FindDocuments(databaseName, collectionName string, query utils.Json) []utils.Json

func (*MongoDBClient) ReplaceDocument

func (mongodbClient *MongoDBClient) ReplaceDocument(databaseName, collectionName string, entry, filter utils.Json) bool

func (*MongoDBClient) UpdateDocument

func (mongodbClient *MongoDBClient) UpdateDocument(databaseName, collectionName string, entry, filter utils.Json) bool

func (*MongoDBClient) UpdateDocumentUpsert

func (mongodbClient *MongoDBClient) UpdateDocumentUpsert(databaseName, collectionName string, entry, filter utils.Json) bool

Jump to

Keyboard shortcuts

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