go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

ERR could not decode requested zset member

Open dropthemasquerade opened this issue 1 year ago • 0 comments

My Code


// FindNearTruck geosearch geohash FROMLONLAT 109.33 24.3 BYRADIUS 200 km ASC
func FindNearTruck(ctx context.Context, long, lat float64, r float64, sort string) []string {
	//
	q := &redis.GeoSearchQuery{
		Member:    "FROMLONLAT",
		Longitude: long,
		Latitude:  lat,
		//Radius:     r,
		//RadiusUnit: "km",
		Sort:      sort,
		BoxWidth:  200,
		BoxHeight: 200,
		BoxUnit:   "km",
	}
	log.WithField("q", q).Info("=================q")
	//result := make([]string, 0)
	result, err := db.RDB.GeoSearch(ctx,"geohash", q).Result()
	if err != nil {
		log.Fatal(err)
		return nil
	}
	log.WithField("q", q).WithField("result", result).
		Info("return")
	return result
}

Expected Behavior

return a list of trucks

Current Behavior

ERR could not decode requested zset member

Possible Solution

No found yet

Steps to Reproduce

  1. geoadd geohash 109.33 24.3 6438ac767c34defda10f1220
  2. i can search by redis-cli
redis-bug

dropthemasquerade avatar Dec 14 '23 17:12 dropthemasquerade