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
Resp2
One of the following:
- 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:
- valkey-protocol(7) Bulk string reply: the value of the key.
- valkey-protocol(7) Null reply: 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), getdel(3valkey), getex(3valkey), getrange(3valkey), incr(3valkey), incrby(3valkey), incrbyfloat(3valkey), lcs(3valkey), mget(3valkey), mset(3valkey), msetnx(3valkey), set(3valkey), setrange(3valkey), strlen(3valkey)
Info
2024-09-23 8.0.0 Valkey Command Manual