GET(3valkey)

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

πŸ’– GET(3valkey) β€” the Valkey Command Manual, bestie edition πŸ’–

okay so. welcome to the GET page of the Valkey Command Manual πŸŽ€ this is genuinely one of the most iconic commands in the whole game, like the main character of key-value storage fr fr.


✨ NAME ✨

get β€” returns the string value of a key. that's it. that's the whole job. and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

GET key

πŸ¦‹ DESCRIPTION πŸ¦‹

Get the value of key. 🫢

So like, if the key does not exist, you get the special value nil back. not an error, not a crash, just a lil nil like "nobody's home bestie πŸ πŸ’¨".

⚠️ BUT. If the value stored at key is not a string, you get an error. Because GET only handles string values. She's a string specialist, okay? don't ask her to do lists, don't ask her to do hashes. she will simply refuse. it's giving boundaries πŸ’€

πŸ’Œ REPLY πŸ’Œ

RESP2

one of the following, no in-between:

RESP3

one of the following, same energy, slightly different name:

(yeah the difference is literally just Nil vs Null, we love a protocol glow-up ✨)


⚑ COMPLEXITY ⚑

O(1)

constant time baby!! no scanning, no searching, no waiting. instant. iconic. the way she just knows πŸ”₯


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@fast @read @string

fast βœ”οΈ read βœ”οΈ string βœ”οΈ β€” a true triple threat πŸ’…


πŸ“œ HISTORY πŸ“œ

  • Available since: 1.0.0 πŸ•°οΈ β€” yeah she's been here since day one. veteran behavior. no cap.

🌈 EXAMPLES 🌈

127.0.0.1:6379> GET nonexisting
(nil)
127.0.0.1:6379> SET mykey "Hello"
OK
127.0.0.1:6379> GET mykey
"Hello"

see how the first one just goes (nil)? that's the "key not found" vibe check failing 😭 and then we SET a value, get an OK, and GET it right back out as "Hello". flawless. ate. no crumbs. πŸ“


πŸ”— SEE ALSO πŸ”—


and that's the whole page bestie πŸ’– go forth and GET responsibly.

this was brought to you by Valkey version 9.0.0, dated 2025-10-21 β€” the GET(3valkey) page, mwah πŸ’‹

πŸ“¦ where this page comes from