Created
August 8, 2014 11:59
-
-
Save elliottcordo/0c600c8a9e58fac1bffa to your computer and use it in GitHub Desktop.
storing and working with timeseries in a redis zset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:6379> zadd mts-123456 20140302 5.6 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140301 7 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140304 3 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140303 2.7 | |
(integer) 1 | |
127.0.0.1:6379> ZRANGEBYSCORE mts-123456 20140301 20140302 | |
1) "7" | |
2) "5.6" | |
127.0.0.1:6379> ZRANGEBYSCORE mts-123456 20140301 20140302 WITHSCORES | |
1) "7" | |
2) "20140301" | |
3) "5.6" | |
4) "20140302" | |
127.0.0.1:6379> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment