Redis Cheat Sheet/Get and delete a key

Atomically fetch and delete a key.

Section: Strings

Get and delete a key

bash
bash
GETDEL temp:token

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Strings
Set a string value
Write a string value.
OpenIn sheetbashsame section
Get a string value
Read a string value.
OpenIn sheetbashsame section
Overwrite a range within a string
Replace bytes starting at an offset.
OpenIn sheetbashsame section
Get a substring
Read a portion of a string by byte offsets.
OpenIn sheetbashsame section
Set value with TTL
Store a string and set expiry atomically.
OpenIn sheetbashsame section
Set only if key does not exist
Common lock-style pattern using NX and EX.
OpenIn sheetbashsame section