Godeps/_workspace/src/gopkg.in/mgo.v2/session.go
func (c *Collection) DropIndex(key ...string) error {
	keyInfo, err := parseIndexKey(key)
	if err != nil {
		return err
	}

	session := c.Database.Session
	cacheKey := c.FullName + "\x00" + keyInfo.name
	session.cluster().CacheIndex(cacheKey, false)

	session = session.Clone()
	defer session.Close()
	session.SetMode(Strong, false)

	db := c.Database.With(session)
	result := struct {
		ErrMsg string
		Ok     bool
	}{}
	err = db.Run(bson.D{{"dropIndexes", c.Name}, {"index", keyInfo.name}}, &result)
	if err != nil {
		return err
	}
	if !result.Ok {
		return errors.New(result.ErrMsg)
	}
	return nil
}
func (c *Collection) DropIndex(key ...string) error {
	keyInfo, err := parseIndexKey(key)
	if err != nil {
		return err
	}

	session := c.Database.Session
	cacheKey := c.FullName + "\x00" + keyInfo.name
	session.cluster().CacheIndex(cacheKey, false)

	session = session.Clone()
	defer session.Close()
	session.SetMode(Strong, false)

	db := c.Database.With(session)
	result := struct {
		ErrMsg string
		Ok     bool
	}{}
	err = db.Run(bson.D{{"dropIndexes", c.Name}, {"index", keyInfo.name}}, &result)
	if err != nil {
		return err
	}
	if !result.Ok {
		return errors.New(result.ErrMsg)
	}
	return nil
}
func ( c * Collection ) DropIndex ( key ... string ) error { keyInfo , err := parseIndexKey ( key ) if err != nil { return err } session := c . Database . Session cacheKey := c . FullName + " \x00 " + keyInfo . name session . cluster ( ) . CacheIndex ( cacheKey , false ) session = session . Clone ( ) defer session . Close ( ) session . SetMode ( Strong , false ) db := c . Database . With ( session ) result := struct { ErrMsg string Ok bool } { } err = db . Run ( bson . D { { " " , c . Name } , { " " , keyInfo . name } } , & result ) if err != nil { return err } if ! result . Ok { return errors . New ( result . ErrMsg ) } return nil }
// DropIndex removes the index with key from the collection.
//
// The key value determines which fields compose the index. The index ordering
// will be ascending by default.  To obtain an index with a descending order,
// the field name should be prefixed by a dash (e.g. []string{"-time"}).
//
// For example:
//
//     err := collection.DropIndex("lastname", "firstname")
//
// See the EnsureIndex method for more details on indexes.
DropIndex removes the index with key from the collection . The key value determines which fields compose the index . The index ordering will be ascending by default . To obtain an index with a descending order the field name should be prefixed by a dash ( e . g . [] string { - time } ) . For example : err : = collection . DropIndex ( lastname firstname ) See the EnsureIndex method for more details on indexes .