SDK
SDK Javascript v5.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.

zrangebylex #

Returns elements in a sorted set where all members have equal score, using lexicographical ordering. The min and max values are inclusive by default. To change this behavior, please check the full documentation.

[Redis documentation] (opens new window)


zrangebylex(key, min, max, [options], [callback]) #

Arguments Type Description
key string Key identifier
min string Minimum member value (inclusive by default)
max string Maximum member value (inclusive by default)
options JSON Object Optional parameters
callback function Callback

Options #

Option Type Description Default
limit array Limit the result set to a range of matching elements (similar to SELECT LIMIT offset, count in SQL).
Format: [<offset(int)>, <count(int)>]
null
queuable boolean Make this request queuable or not true

Return Value #

Returns the MemoryStorage object to allow chaining.


Callback Response #

Returns an array of matching members.

Usage #

Copied to clipboard!
// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.zrangebylex('key', '-', '(g', function (err, members) {
  // callback called once the action has completed
});
// Using promises (NodeJS only)
kuzzle.memoryStorage.zrangebylexPromise('key', '-', '(g')
  .then(members => {
    // resolved once the action has completed
  });

Callback response:

Copied to clipboard!
["member1", "member2", "..."]