get.3valkey - Man Page
Returns the string value of a key.
Synopsis
GET key
Description
Get the value of key. If the key does not exist the special value nil is returned. An error is returned if the value stored at key is not a string, because GET only handles string values.
Reply
One of the following:
- String: the value of the key.
- Null: if the key does not exist.
Complexity
O(1)
Acl Categories
@fast @read @string
History
- Available since: 1.0.0
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 Also
append(3valkey), decr(3valkey), decrby(3valkey), delex(3valkey), delifeq(3valkey), getdel(3valkey), getex(3valkey), getrange(3valkey), getset(3valkey), incr(3valkey), incrby(3valkey), incrbyfloat(3valkey), increx(3valkey), lcs(3valkey), mget(3valkey), mset(3valkey), msetex(3valkey), msetnx(3valkey), psetex(3valkey), set(3valkey), setex(3valkey), setnx(3valkey), setrange(3valkey), strlen(3valkey), substr(3valkey)
Info
2026-11-19 9.2.0 Valkey Command Manual