This is not necessary since member in a set are always unique.
From the ZADD documentation (http://redis.io/commands/zadd):
"If a specified member is already a member of the sorted set, the
score is updated and the element reinserted at the right position to
ensure the correct ordering"
ciao ciao,
matteo.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
yes it is possible that if your two queries are inside the same TCP
frame Redis will process it in an atomic fashion, but this is just a
side effect of the implementation and is not guaranteed.
Cheers,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>
--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele
Generally, to do it properly requires one of 2 methods. Either using
WATCH/MULTI/EXEC
WATCH queue
score = ZSCORE queue member
if !score:
MULTI
ZADD queue time() member
EXEC
else:
UNWATCH queue
Or using the scripting branch.
- Josiah