redis GET command


  Translation results:

英[get] 美[ɡɛt]

vt. Get; catch; persuade; receive (punishment, etc.)

vt.& vi. Arrive, come

vi.Become; start; try to deal with; obtain benefits or wealth

n.Reproduction, cub; profit

Third person singular: gets Present participle: getting Past tense: got Past participle: gotgot

redis GET commandsyntax

Function: Return the string value associated with key. If key does not exist then the special value nil is returned. If the value stored in key is not of string type, an error is returned because GET can only be used to process string values.

Syntax: GET key

Available versions:>= 1.0.0

Time complexity: O(1)

Return: When key does not exist, return nil, otherwise, return the value of key. If key is not of type string, an error is returned.

redis GET commandexample

# 对不存在的 key 或字符串类型 key 进行 GET
redis> GET db
(nil)
redis> SET db redis
OK
redis> GET db
"redis"
# 对不是字符串类型的 key 进行 GET
redis> DEL db
(integer) 1
redis> LPUSH db redis mongodb mysql
(integer) 3
redis> GET db
(error) ERR Operation against a key holding the wrong kind of value

Popular Recommendations

Home

Videos

Q&A