In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Five data types supported by redis: string (string), Hash (hash), list (list), set (collection), and zset (ordered collection)
2. String is the most basic type of redis. A key can support storing 512MB at most.
Set name "lanyulei"
Del name
/ / set a key to be name, and the corresponding value to be a string of Lan Yulei
Get name
/ / result set is "lanyulei"
3. Redis hash is a mapping table of field and value of string type, and hash is especially suitable for storing objects.
Hmset user username lanyulei sex man age 25
/ / set a hash value. Key is an even-numbered form of user,value.
Each hash can store 2 to the power of 32-1, key-value pairs (more than 4 billion)
4. Redis is a simple list of strings, sorted in the order in which they are inserted, and you can add the header or tail of the element lead list.
/ / set a list type data named lanyulei, and the content is added and displayed sequentially.
Lpush lanyulei redis
Lpush lanyulei mongodb
Lpush lanyulei rabitmq
/ / to get the value,0 10 of this list "lanyulei" means to get the data before the subscript 0 to 10.
Lrange lanyulei 0 10
5. Unordered collection creation
/ / set an unordered collection
Sadd lanyulei redis
Sadd lanyulei mongodb
Sadd lanyulei mysql
Sadd lanyulei mysql
/ / get the contents of this collection
Smembers lanyulei
6. Creation of ordered sets
/ / an ordered collection, like a collection, is a collection of elements of type string, and duplicate members are not allowed.
/ / the members of an ordered set are unique, but the score can be repeated.
Zadd lanyulei redis
Zadd lanyulei mongodb
Zadd lanyulei mysql
Zadd lanyulei mysql
/ / get the contents of this collection
Zmembers lanyulei
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.