VRANGE key start end [count]
The VRANGE command provides a stateless iterator for the elements inside a vector set. It allows you to retrieve all the elements inside a vector set in small amounts for each call, without an explicit cursor, and with guarantees about what you will miss in case the vector set is changing (elements added and/or removed) during the iteration.
The command returns elements in lexicographical order, using byte-by-byte comparison (like memcmp()) to establish a total order among elements.
keyThe name of the vector set key from which to retrieve elements.
startThe starting point of the lexicographical range. Can be:
[ for inclusive range (e.g., [Redis)( for exclusive range (e.g., (a7)- to indicate the minimum elementendThe ending point of the lexicographical range. Can be:
[ for inclusive range( for exclusive range+ to indicate the maximum elementcountThe maximum number of elements to return. If count is negative, the command returns all elements in the specified range (which may block the server for a long time with large sets).
Retrieve the first 10 elements starting from the string "Redis" (inclusive):
VRANGE word_embeddings [Redis + 10
Iterate through all elements, 10 at a time:
VRANGE mykey - + 10
Continue iteration from the last element of the previous result (exclusive):
VRANGE mykey (a7 + 10
Return all elements in the set (use with caution):
VRANGE mykey - + -1
One of the following:
VRANGE command was executed.