Godeps/_workspace/src/gopkg.in/mgo.v2/session.go
func (s *Session) BuildInfo() (info BuildInfo, err error) {
	err = s.Run(bson.D{{"buildInfo", "1"}}, &info)
	if len(info.VersionArray) == 0 {
		for _, a := range strings.Split(info.Version, ".") {
			i, err := strconv.Atoi(a)
			if err != nil {
				break
			}
			info.VersionArray = append(info.VersionArray, i)
		}
	}
	for len(info.VersionArray) < 4 {
		info.VersionArray = append(info.VersionArray, 0)
	}
	if i := strings.IndexByte(info.GitVersion, ' '); i >= 0 {
		// Strip off the " modules: enterprise" suffix. This is a _git version_.
		// That information may be moved to another field if people need it.
		info.GitVersion = info.GitVersion[:i]
	}
	return
}
func (s *Session) BuildInfo() (info BuildInfo, err error) {
	err = s.Run(bson.D{{"buildInfo", "1"}}, &info)
	if len(info.VersionArray) == 0 {
		for _, a := range strings.Split(info.Version, ".") {
			i, err := strconv.Atoi(a)
			if err != nil {
				break
			}
			info.VersionArray = append(info.VersionArray, i)
		}
	}
	for len(info.VersionArray) < 4 {
		info.VersionArray = append(info.VersionArray, 0)
	}
	if i := strings.IndexByte(info.GitVersion, ' '); i >= 0 {
		// Strip off the " modules: enterprise" suffix. This is a _git version_.
		// That information may be moved to another field if people need it.
		info.GitVersion = info.GitVersion[:i]
	}
	return
}
func ( s * Session ) BuildInfo ( ) ( info BuildInfo , err error ) { err = s . Run ( bson . D { { " " , " " } } , & info ) if len ( info . VersionArray ) == 0 { for _ , a := range strings . Split ( info . Version , " " ) { i , err := strconv . Atoi ( a ) if err != nil { break } info . VersionArray = append ( info . VersionArray , i ) } } for len ( info . VersionArray ) < 4 { info . VersionArray = append ( info . VersionArray , 0 ) } if i := strings . IndexByte ( info . GitVersion , ' ' ) ; i >= 0 { // Strip off the " modules: enterprise" suffix. This is a _git version_. // That information may be moved to another field if people need it. info . GitVersion = info . GitVersion [ : i ] } return }
// BuildInfo retrieves the version and other details about the
// running MongoDB server.
BuildInfo retrieves the version and other details about the running MongoDB server .