GETRANGE
Introduction
In Dragonfly, as well as in Redis and Valkey, the GETRANGE command is used to retrieve a substring from a string stored at a specific key.
It allows you to extract characters from the stored string by specifying the starting and ending offsets (both inclusive), based on byte positions.
This is a useful tool when you want portions of a string without fetching the entire value.
Syntax
GETRANGE key start end
- Time complexity: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.
- ACL categories: @read, @string, @slow