GET(3valkey)
π 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 atkeyis not a string, you get an error. BecauseGETonly 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:
- valkey-protocol(7) Bulk string reply: the value of the key. π
- valkey-protocol(7) Nil reply: if the key does not exist. π«₯
RESP3
one of the following, same energy, slightly different name:
- valkey-protocol(7) Bulk string reply: the value of the key. π
- valkey-protocol(7) Null reply: if the key does not exist. π«₯
(yeah the difference is literally just Nil vs Null, we love a protocol glow-up β¨)
β‘ COMPLEXITY β‘
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 π
append(3valkey)decr(3valkey)decrby(3valkey)delifeq(3valkey)getdel(3valkey)getex(3valkey)getrange(3valkey)getset(3valkey)incr(3valkey)incrby(3valkey)incrbyfloat(3valkey)lcs(3valkey)mget(3valkey)mset(3valkey)msetnx(3valkey)psetex(3valkey)set(3valkey)setex(3valkey)setnx(3valkey)setrange(3valkey)strlen(3valkey)substr(3valkey)
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
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms