// GetByField use field value for token information data
GetByField use field value for token information data
// GetByField use field value for token information data
func (ts *MgoTokenStore) GetByBson(m bson.M) (ti oauth2.TokenInfo, err error) {
	ts.H(ts.collection, func(c *mongo.Collection) {
		token := &TokenData{}
		mgoErr := c.FindOne(nil, m).Decode(token)
		if mgoErr != nil {
			if mgoErr == mongo.ErrNoDocuments {
				err = o2x.ErrNotFound
				return
			}
			err = mgoErr
			return
		}
		ti = token
	})
	return
}
func ( ts * MgoTokenStore ) GetByBson ( m bson . M ) ( ti oauth2 . TokenInfo , err error ) { ts . H ( ts . collection , func ( c * mongo . Collection ) { token := & TokenData { } mgoErr := c . FindOne ( nil , m ) . Decode ( token ) if mgoErr != nil { if mgoErr == mongo . ErrNoDocuments { err = o2x . ErrNotFound return } err = mgoErr return } ti = token } ) return }
GetByField use field value for token information data
GetByField use field value for token information data