What is a ZSET in a Redis database?

What is zset in a redis database. I have a redis database with some data. To get the values

KEYS *apple* 1) "compleet-index:products:apple" 2) "compleet-index:brands:apple" 

after receiving the key

 GET compleet-index:productos:apple 

and I had an answer

 (error) WRONGTYPE Operation against a key holding the wrong kind of value 

I get type

 TYPE compleet-index:productos:iphone zset 

When i do

 DUMP compleet-index:productos:iphone 

I get exas codes.

+7
redis
source share
1 answer

Short answer: use ZRANGE compleet-index:products:apple 0 -1 WITHSCORES

ZSET is the short name for the Redis Sorted Set, the Redis data type described here . Each key in a sorted set has several values ​​inside that are related to evaluating a floating value.

+15
source share

All Articles