method
RedisClient.substr
start: number,
end: number,
With RedisClient.ReplyOptions.
Referenced types
type KeyLike = string | ArrayBufferView | Blob
interface ReplyOptions<AsBuffer extends boolean | undefined = boolean | undefined>
The last argument of a command whose reply can have stored data.
- buffer: AsBuffer
Get the bulk and verbatim strings of the reply, at any depth, as Buffers instead of UTF-8 text. Redis sends stored values and stream IDs as bulk strings. Status replies such as
"OK", integers, doubles,nulland the cursor of a scan method do not change. The keys of an object are strings. If one is not UTF-8 text, the command rejects withERR_ENCODING_INVALID_ENCODED_DATA, anderror.replyhas[key, value]pairs. In a transaction, that error is the result in the reply toEXEC.await redis.hset("images", "logo", new Uint8Array([0xff, 0xd8])); await redis.hget("images", "logo", { buffer: true }); // <Buffer ff d8>
type Data<AsBuffer extends boolean | undefined> = AsBuffer extends true ? Buffer<ArrayBuffer> : string
A bulk string of a reply, as ReplyOptions asks for it.