Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2010-07-19 12:42:26 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2010-07-19 12:42:26 +0400
commit6d6b1339e8d435fa2184d90d8d2d6c33e7749e48 (patch)
tree6d6d04c6672b4024694fdad8785627d9f91e0250 /README.markdown
parentc27cc5b82f68bdd8e6cc98c5afeeb7eac8d308e5 (diff)
Added ZRANK, ZREVRANK.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 874199b0..a0ddb13a 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1333,6 +1333,25 @@ $redis->zAdd('key', 2.5, 'val2');
$redis->zScore('key', 'val2'); /* 2.5 */
</pre>
+## zRank, zRevRank
+##### *Description*
+Returns the rank of a given member in the specified sorted set, starting at 0 for the item with the smallest score. zRevRank starts at 0 for the item with the *largest* score.
+##### *Parameters*
+*key*
+*member*
+##### *Return value*
+*Long*, the item's score.
+##### *Example*
+<pre>
+$redis->delete('z');
+$redis->zAdd('key', 1, 'one');
+$redis->zAdd('key', 2, 'two');
+$redis->zRank('key', 'one'); /* 0 */
+$redis->zRank('key', 'two'); /* 1 */
+$redis->zRevRank('key', 'one'); /* 1 */
+$redis->zRevRank('key', 'two'); /* 0 */
+</pre>
+
## zIncrBy
##### Description
Increments the score of a member from a sorted set by a given amount.