mongotools

package module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCollection

func GetCollection(db *mgo.Database, collection string) (*mgo.Collection, error)

GetCollection returns the specified collection from db, or an error if the collection is not present.

func GetDatabase

func GetDatabase(S *mgo.Session, database string) (*mgo.Database, error)

GetDatabase returns the specified database, or an error if the database is not present.

func GetDatabaseAndCollection

func GetDatabaseAndCollection(S *mgo.Session, database string, collection string) (*mgo.Database, *mgo.Collection, error)

GetDatabaseAndCollection returns the specified database and collection, or an error if either is not present

func RunCommandAndUnmarshal

func RunCommandAndUnmarshal(S *mgo.Session, database string, command interface{}, X interface{}) error

RunCommandAndUnmarshal runs the specified command on the specified database, unmarshalling the result into X. The command can either be a string equal to the command name, or an mgo bson.M document with the full command.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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