SDK
SDK Java v2.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

zscan #

Identical to scan, except that zscan iterates the members held by a sorted set.

[Redis documentation]


zscan(key, cursor, [options], callback) #

Arguments Type Description
key string Key identifier
cursor int Page number (iteration starts with a cursor value of 0, and ends when the next cursor position is 0)
options JSON Object Optional parameters
callback function Callback

Options #

Option Type Description Default
count int Return the approximate count number of items per result page 10
match string Search only for member values matching the provided pattern *
queuable boolean Make this request queuable or not true

Callback Response #

Returns a JSON array containing 2 entries:

  • the cursor position for the next page of results (a next position of 0 indicates the end of the scan)
  • an array of sorted set members and their associated scores

Usage #

Copied to clipboard!
kuzzle.memoryStorage.zscan("key", 0, new ResponseListener<JSONObject>() {
  @Override
  public void onSuccess(JSONObject page) {
    // callback called once the action has completed
  }
  @Override
  public void onError(JSONObject error) {
  }
});

Callback response:

Copied to clipboard!
{
  "cursor": 18,
  "values": ["member1", "member1's score", "member2", "member2's score", "..."]
}