zrevrank

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.zrevrank('key', 'foo', function (err, position) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.zrevrankPromise('key', 'foo')
  .then(position => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.zrevrank("key", "member", new ResponseListener<Long>() {
  @Override
  public void onSuccess(int position) {
    // callback called once the action has completed
  }

  @Override
  public void onError(JSONObject error) {
  }
});
<?php

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $position = $kuzzle->memoryStorage()->zrevrank('key', 'foo');
}
catch (ErrorException $e) {

}

Callback response:

0

Returns the position of an element in a sorted set, with scores in descending order. The index returned is 0-based (the lowest score member has an index of 0).

[Redis documentation]


zrevrank(key, member, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
memberstringMember of the sorted set
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue

Callback response

Resolves to an integer containing the member's position in the sorted set.