<i>Time complexity: O(log(N))</i><blockquote>ZRANK returns the rank of the member in the sorted set, with scores ordered from low to high. ZREVRANK returns the rank with scores ordered from high to low. When the given member does not exist in the sorted set, the special value 'nil' is returned. The returned rank (or index) of the member is 0-based for both commands.</blockquote>
<h2><aname="Return value">Return value</a></h2><ahref="ReplyTypes.html">Integer reply</a> or a nil <ahref="ReplyTypes.html">bulk reply</a>, specifically:<br/><br/><preclass="codeblock python"name="code">
the rank of the element as an integer reply if the element exists.