--
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.
On Wed, Feb 23, 2011 at 01:55:16PM +0530, Manula Thantriwatte wrote:
> Sorted sets in Redis didn't allow duplicates. Can we allow duplicates in
> sorted sets ?
The usual trick involves composing values in the set using the score. For time
series data, where the score is a timestamp and the value is a number, this
should be enough to preserve the unique-ness of potentially repeating values.
Eg:
ZADD time.series 1298460338 "1298460348 9"
ZADD time.series 1298460348 "1298460348 10"
ZADD time.series 1298460358 "1298460358 11"
Your client would then need to split the values it receives from Redis in order
to get the actual value.
--
Will Maier
http://will.m.aier.us/