Back to Redis

GETDEL

content/commands/getdel.md

latest1.4 KB
Original Source

Get the value of key and delete the key. This command is similar to [GET]({{< relref "/commands/get" >}}), except for the fact that it also deletes the key on success (if and only if the key's value type is a string).

Examples

{{% redis-cli %}} SET mykey "Hello" GETDEL mykey GET mykey {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="getdel-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

-tab-sep-

One of the following:

{{< /multitabs >}}