DEL(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ DEL β€” the manual page, but make it cute ✨

okay bestie, welcome to del(3valkey), the Valkey Command Manual entry for literally the most satisfying command in the whole keyspace. yes we're doing this. πŸ’…


🌸 NAME 🌸

del β€” Deletes one or more keys. that's it. that's the whole vibe. goodbye key, you served. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

DEL key [key...]

πŸ’– DESCRIPTION πŸ’–

so the tea is: DEL removes the specified keys. boom. gone.

and if a key doesn't exist? it's just ignored. no error, no drama, no "umm excuse me where's the key" β€” it simply doesn't exist so there's nothing to delete and we move on. main character energy honestly. ✨


🌈 REPLY 🌈

valkey-protocol(7) Integer reply: the number of keys that were removed. πŸ‘‘

so if you hand it five keys and only two were real, you get 2. the imaginary ones get no credit. no cap.


πŸ¦‹ COMPLEXITY πŸ¦‹

this is the part where it gets slightly nerdy but stay with me:

  • O(N) where N is the number of keys that will be removed.
  • but WAIT β€” when a key you're removing holds a value that isn't a string, the individual complexity for that key is O(M), where M is the number of elements in the list, set, sorted set or hash. so like, yeeting a whole giant hash is more work than yeeting one little string, obviously.
  • removing a single key that holds a string value is O(1). snappy. iconic. no thoughts head empty. ⭐

πŸ”₯ ACL CATEGORIES πŸ”₯

  • @keyspace
  • @slow
  • @write

🧚 HISTORY 🧚

  • Available since: 1.0.0 β€” yeah she's been here since the beginning, an OG, a legend, a founding member of the group chat πŸ’œ

πŸ‘‘ EXAMPLES πŸ‘‘

127.0.0.1:6379> SET key1 "Hello"
OK
127.0.0.1:6379> SET key2 "World"
OK
127.0.0.1:6379> DEL key1 key2 key3
(integer) 2

see what happened there? we set key1 and key2, then asked DEL to remove key1, key2 and key3. key3 never existed so she got ignored, and the reply is (integer) 2 β€” two keys actually removed. ate. πŸ”₯


🌟 SEE ALSO 🌟

like, go read these too, they're all part of the same little ecosystem bestie:


πŸ’€ lowkey important: DEL is the classic, but if you're deleting something huge and you don't wanna block everything, maybe peek at her cousin unlink(3valkey) up there in the SEE ALSO. iykyk.

okay that's the page!! this manual is from Valkey version 9.0.0, dated 2025-10-21, and it lives under the name DEL(3valkey). go forth and delete responsibly, bestie. mwah. πŸ’–πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from