Arguments
string
required
The key
TValue
required
The value, if this is not a string, we will use
JSON.stringify to convert it
to a string.object
You can pass a few options to the command.
Response
"OK"Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
await redis.set("my-key", {my: "value"});
await redis.set("my-key", {my: "value"}, {
ex: 60
});
await redis.set("my-key", {my: "value"}, {
xx: true
});
Set a key to hold a string value.
JSON.stringify to convert it
to a string.Show child attributes
"OK", this will cause the command to return the old
value stored at key, or null when key did not exist."OK"await redis.set("my-key", {my: "value"});
await redis.set("my-key", {my: "value"}, {
ex: 60
});
await redis.set("my-key", {my: "value"}, {
xx: true
});
Was this page helpful?