In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
# introduction to string
String type is the most basic data type of redis. A key corresponds to a value, and a key can store a maximum 512Mb.
String is binary secure.
# Common commands:
> set mykey "dang"
OK
> get mykey
"dang"
> set mykey "nihao" # multiple assignments will overwrite the original value
OK
> get mykey
"nihao"
> mset key1 1 key2 2 key3 e # multiple assignments
OK
> mget key1 key2 key3 # take multiple values
1) "1"
2) "2"
3) "e"
> setnx mykey 111I returned 0
(integer) 0
> setnx mykey2 111 # returns 1
(integer) 1
> get mykey2
"111"
# setnx if key exists, 0 is returned, and the existing value is not overwritten. The key is created directly if it does not exist.
> setex key6 30 yes # sets the expiration time, with the validity period in front and the value in the end
OK
> ttl key6 # gets the expiration time. If there is no expiration time,-1 is returned.
(integer) 25
> ttl mykey2
(integer)-1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.