ZAdd not working
nkumar15 opened this issue · 1 comments
nkumar15 commented
Hi
I am using version v7 to add a sorted set in redis with below code. Ping is successful.
However I don't see score and member inserted in redis key.
Not sure I am doing it correctly or not. Can somebody confirm please?
package main
import (
"fmt"
"github.com/go-redis/redis/v7"
)
func main() {
rdb := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "",
DB: 0,
})
pong, err := rdb.Ping().Result()
fmt.Println(pong, err)
_, err = rdb.ZAdd("mykey", &redis.Z{1, "some string"}).Result()
if err != nil {
fmt.Errorf("%v", err)
}
}
Expected: score and member to be present in redis
Result: score and member not present.
nkumar15 commented
Closing it as I by mistake opened in wrong place