|
SremCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
► Sign in to add a comment
|
Search
|
|
SremCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
It would be really nice that if I delete a KEY that is associated to a SET, the SET would remove that obsolete key automatically.
If I am not mistaken, it appears that a SREM on a nonexistent key returns 0, not an error.
Most other operations return an error when an operations is performed on the wrong data type, so I guess this one should too.
Hello r.dahlen, actually all this kind of operations against empty keys all assume an empty Set or List. For instance LLEN will return 0 against empty keys, and SELEMENTS will return an empty set against non existing keys, and so forth.
The only exception is LREM, and should be fixed indeed...
It should be noted that if you SREM the last element of a set the key is removed `(i.e. sadd test 1 srem test 1 exists test )`
Will return `1 1 0`