Skip to content
Console
On this page

Zset range in KV

Reads a range of a sorted set by rank, lowest score first (ZRANGE); negative indexes count from the end.

Reads a range of a sorted set by rank, lowest score first (ZRANGE); negative indexes count from the end.

  • Path POST https://api.data.sylphx.com/v1/kv-zset-ranges
  • Scope data:read
  • Effect read — nothing is written.
  • Collection kv
  • Host https://api.data.sylphx.com

Request

FieldTypeWhat it is
namespace_idstringThe namespace's id. Required.
keystringThe sorted set's key. Required.
startint64The first rank, inclusive; unset is 0, negative counts from the end.
stopint64The last rank, inclusive; unset is -1 (the end).
with_scoresboolWhether to answer each member's score.

Response

FieldTypeWhat it is
membersZSetMember[]The members in the range, lowest score first.

ZSetMember

FieldTypeWhat it is
memberstringThe member. Required.
scoredoubleThe score; unset in a range read without with_scores.

Errors

Every error arrives in the body Errors describes.

Examples

curl -X POST "https://api.data.sylphx.com/v1/kv-zset-ranges" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key":"…","namespace_id":"…"}'