My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SremCommand  
Updated Dec 21, 2010 by anti...@gmail.com

We moved to Redis.io!

Redis home moved to http://redis.io, please visit our new home.

Comment by alomba...@gmail.com, Apr 23, 2009

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.

Comment by r.dahlen@gmail.com, Jun 5, 2009

If I am not mistaken, it appears that a SREM on a nonexistent key returns 0, not an error.

./redis-cli SREM nonexistentkey foobar

Most other operations return an error when an operations is performed on the wrong data type, so I guess this one should too.

Comment by project member anti...@gmail.com, Jun 5, 2009

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...

Comment by rowan%wo...@gtempaccount.com, Dec 8, 2010

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`


Sign in to add a comment
Powered by Google Project Hosting