Skip to content

Instantly share code, notes, and snippets.

@mmcdaris
Created February 5, 2015 17:58
Show Gist options
  • Save mmcdaris/af3ede874257c38d7d53 to your computer and use it in GitHub Desktop.
Save mmcdaris/af3ede874257c38d7d53 to your computer and use it in GitHub Desktop.
Simple Redis ScoreBoard with a sorted set
127.0.0.1:6379> ZADD FEB-SCORES 0 "JP"
(integer) 1
127.0.0.1:6379> ZADD FEB-SCORES 0 "MORGAN"
(integer) 1
127.0.0.1:6379> ZINCRBY FEB-SCORES 10 "MORGAN"
"10"
127.0.0.1:6379> ZINCRBY FEB-SCORES 20 "JP"
"20"
127.0.0.1:6379> ZREVRANGE FEB-SCORES 0 -1 WITHSCORES
1) "JP"
2) "20"
3) "MORGAN"
4) "10"
127.0.0.1:6379>
@mmcdaris
Copy link
Author

mmcdaris commented Feb 5, 2015

ZADD is what we can run when a user opts in
ZINCRBY is what we can use when they complete their daily scrum
ZREVRANGE will give us the scoreboard data!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment