mongo

package
v0.0.0-...-dd4b6ca Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient

type MongoClient struct {
	Cancel func()
	// contains filtered or unexported fields
}

MongoClient is exported.

func New

func New(host string, port int) *MongoClient

New is exported.

func (*MongoClient) CountDocuments

func (mc *MongoClient) CountDocuments(db, coll string) (int64, error)

CountDocuments return number of documents in the collection.

func (*MongoClient) ListCollectionNames

func (mc *MongoClient) ListCollectionNames(databaseName string) ([]string, error)

ListCollectionNames returns collection names in a given database.

func (*MongoClient) ListDatabaseNames

func (mc *MongoClient) ListDatabaseNames() ([]string, error)

ListDatabaseNames returns all database names.

func (*MongoClient) ListDocuments

func (mc *MongoClient) ListDocuments(databaseName, collectionName string) ([]bson.M, []error)

ListDocuments return list of decoded documents and errors during the process.

func (*MongoClient) Ping

func (mc *MongoClient) Ping() error

Ping connection.

Jump to

Keyboard shortcuts

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