Upstash Documentation

Range

2 min read

The range method is used to retrieve documents in chunks with pagination. This method supports a variety of options to configure the query to your needs.

Note

The range command is stateless, meaning you need to pass all of the parameters in each subsequent request.

Arguments#

cursorstringrequired#

The cursor to the last retrieved document. Should be set to 0 in the initial range request.

prefixstring#

A string prefix to match document IDs. All documents with IDs that start with this prefix will be retrieved.

limitnumberrequired#

The number of maximum documents wanted in the response of range. (page size)

Response#

RangeResponseObjectrequired#
Show properties
nextCursorstring#

The cursor for the next set of documents. When it becomes "", it means all documents were retrieved.

documentsDocument[]#

The list of documents retrieved in this range.