Sunday 12 April 2015

ZINCRBY key increment member

Syntax
ZINCRBY key increment member
    Increments the score of the member by increment.

Returns
Returns the new score the member.

127.0.0.1:6379> zadd city 1.5 Bombay 0.9 Hyderabad 2.3 Vijayawada 3.2 Delhi 
(integer) 4 
127.0.0.1:6379> zrange city 0 3 withscores 
1) "Hyderabad" 
2) "0.90000000000000002" 
3) "Bombay" 
4) "1.5" 
5) "Vijayawada" 
6) "2.2999999999999998" 
7) "Delhi" 
8) "3.2000000000000002" 
127.0.0.1:6379> 
127.0.0.1:6379> zincrby city 1.5 Bombay 
"3" 
127.0.0.1:6379> 
127.0.0.1:6379> zrange city 0 3 withscores 
1) "Hyderabad" 
2) "0.90000000000000002" 
3) "Vijayawada" 
4) "2.2999999999999998" 
5) "Bombay" 
6) "3" 
7) "Delhi" 
8) "3.2000000000000002" 

 
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment