Search…
⌘K
Ask AI
⌘I
Discord
Blog
Twitter
Console
Overview
Redis
Vector
QStash
Workflow
Search
Box
Realtime
Developer API
Redis
SDKs
Typescript
Commands
String
GETSET
Return the value of the specified key and replace it with a new value.
1 min read
Copy as Markdown
Arguments
#
key
string
required
#
The key to get.
newValue
required
#
The new value to store.
Response
#
GETRANGE
INCR
Example
const
oldValue
=
await
redis.
getset
(
"key"
, newValue);