Documentation ¶
Index ¶
- func GetCollection(db *mgo.Database, collection string) (*mgo.Collection, error)
- func GetDatabase(S *mgo.Session, database string) (*mgo.Database, error)
- func GetDatabaseAndCollection(S *mgo.Session, database string, collection string) (*mgo.Database, *mgo.Collection, error)
- func RunCommandAndUnmarshal(S *mgo.Session, database string, command interface{}, X interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCollection ¶
GetCollection returns the specified collection from db, or an error if the collection is not present.
func GetDatabase ¶
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.
Click to show internal directories.
Click to hide internal directories.