Godeps/_workspace/src/gopkg.in/mgo.v2/session.go
func (db *Database) Run(cmd interface{}, result interface{}) error {
	socket, err := db.Session.acquireSocket(true)
	if err != nil {
		return err
	}
	defer socket.Release()

	// This is an optimized form of db.C("$cmd").Find(cmd).One(result).
	return db.run(socket, cmd, result)
}
func (db *Database) Run(cmd interface{}, result interface{}) error {
	socket, err := db.Session.acquireSocket(true)
	if err != nil {
		return err
	}
	defer socket.Release()

	// This is an optimized form of db.C("$cmd").Find(cmd).One(result).
	return db.run(socket, cmd, result)
}
func ( db * Database ) Run ( cmd interface { } , result interface { } ) error { socket , err := db . Session . acquireSocket ( true ) if err != nil { return err } defer socket . Release ( ) // This is an optimized form of db.C("$cmd").Find(cmd).One(result). return db . run ( socket , cmd , result ) }
// Run issues the provided command on the db database and unmarshals
// its result in the respective argument. The cmd argument may be either
// a string with the command name itself, in which case an empty document of
// the form bson.M{cmd: 1} will be used, or it may be a full command document.
//
// Note that MongoDB considers the first marshalled key as the command
// name, so when providing a command with options, it's important to
// use an ordering-preserving document, such as a struct value or an
// instance of bson.D.  For instance:
//
//     db.Run(bson.D{{"create", "mycollection"}, {"size", 1024}})
//
// For privilleged commands typically run on the "admin" database, see
// the Run method in the Session type.
//
// Relevant documentation:
//
//     http://www.mongodb.org/display/DOCS/Commands
//     http://www.mongodb.org/display/DOCS/List+of+Database+CommandSkips
//
Run issues the provided command on the db database and unmarshals its result in the respective argument . The cmd argument may be either a string with the command name itself in which case an empty document of the form bson . M { cmd : 1 } will be used or it may be a full command document . Note that MongoDB considers the first marshalled key as the command name so when providing a command with options it s important to use an ordering - preserving document such as a struct value or an instance of bson . D . For instance : db . Run ( bson . D {{ create mycollection } { size 1024 }} ) For privilleged commands typically run on the admin database see the Run method in the Session type . Relevant documentation : http : // www . mongodb . org / display / DOCS / Commands http : // www . mongodb . org / display / DOCS / List + of + Database + CommandSkips