In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to use redis for everyone. Xiaobian thinks it is quite practical, so share it with everyone for reference. I hope you can gain something after reading this article.
First, let's introduce the five types of redis:
String, hash, list, set, sorted set.
Controller:@Resource RedisTemplate redisTemplate;
Summary:
redisTemplate.opsForValue();//action string
redisTemplate.opsForHash();//operation hash
redisTemplate.opsForList();//action list
redisTemplate.opsForSet();//operation set
redisTemplate.opsForZSet();//operation ordered set
String:
1.redisTemplate.opsForValue().set(key,value));
2.redisTemplate.opsForValue().get(key));
3.redisTemplate.opsForValue().get(key, start, end);
4.redisTemplate.opsForValue().getAndSet(key, value);
5.redisTemplate.opsForValue().getBit(key, offset);//Comments below
6.redisTemplate.opsForValue().multiGet(keys);
7.redisTemplate.opsForValue().setBit(key, offset, value);//Comments below
8.redisTemplate.opsForValue().set(K key, V value, long timeout, TimeUnit unit);//TimeUnit is the type of timeout, such as ms\s\days
9.redisTemplate.opsForValue().setIfAbsent(key, value);
10.redisTemplate.opsForValue().set(K key, V value, long offset);//blogger does not do java validation here
11.redisTemplate.opsForValue().size(key));
12.redisTemplate.opsForValue().multiGet(Collection keys);
13.redisTemplate.opsForValue().multiSetIfAbsent(Map
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.