// Decode will attempt to decode the first document into v. If there was an
// error from the operation that created this SingleResult then the error
// will be returned. If there were no returned documents, ErrNoDocuments is
// returned. If v is nil or is a typed nil, an error will be returned.
Decode will attempt to decode the first document into v. If there was an
error from the operation that created this SingleResult then the error
will be returned. If there were no returned documents, ErrNoDocuments is
returned. If v is nil or is a typed nil, an error will be returned.
// Decode will attempt to decode the first document into v . If there was an // error from the operation that created this SingleResult then the error // will be returned . If there were no returned documents ErrNoDocuments is // returned . If v is nil or is a typed nil an error will be returned .
func (sr *SingleResult) Decode(v interface{}) error {
	if sr.err != nil {
		return sr.err
	}
	if sr.reg == nil {
		return bson.ErrNilRegistry
	}
	if sr.err = sr.setRdrContents(); sr.err != nil {
		return sr.err
	}
	return bson.UnmarshalWithRegistry(sr.reg, sr.rdr, v)
}
func ( sr * SingleResult ) Decode ( v interface { } ) error { if sr . err != nil { return sr . err } if sr . reg == nil { return bson . ErrNilRegistry } if sr . err = sr . setRdrContents ( ) ; sr . err != nil { return sr . err } return bson . UnmarshalWithRegistry ( sr . reg , sr . rdr , v ) }
Decode will attempt to decode the first document into v. If there was an
error from the operation that created this SingleResult then the error
will be returned.
Decode will attempt to decode the first document into v . If there was an error from the operation that created this SingleResult then the error will be returned .