当前位置:网站首页>Redis type
Redis type
2022-07-28 04:42:00 【Cheng Cheng, it's Xiaobai】
Catalog

This article is my previous notes , If I saw it on the Nuggets, it's right , Or myself Cheng Cheng My personal homepage - article - Nuggets This is the only one . If there is anything wrong, you are welcome to point out the problem , I am a little white .
The link of the last article is :Redis6_ Cheng Cheng is Xiaobai's blog -CSDN Blog , This article is a link to the previous article Redis6_ Cheng Cheng is Xiaobai's blog -CSDN Blog Of .
If it is springboot If so, please see springboot Create project _ Cheng Cheng is Xiaobai's blog -CSDN Blog , This is from scratch, not finished springboot, Study together !!!!
Redis type
1 String( character string ):
APPEND key: Append string , If at present key non-existent , Equivalent to setkey
STRLEN key: Get string length
step :set views The initial value is 0
incr views : Self increasing 1
Decr views : Self reduction 1
INCRBY views 10: You can set the step , Specify increment
DECRBY views5: You can set the step , Specify decrement
String range range:
GETRANGE key1 0 3( Intercepting string 0 To 3)
Replace : SETRANGE key2 1 xx( Replace the string starting at the specified position )
Setex : Set expiration time
Setnx : Does not exist in setting . Create without , There is a prompt that the creation failed
Mset : Set multiple values at the same time
Mget : Get multiple values at the same time
Msetnx : It's an atomic operation , Or make it together , Or fail together
Getset : First get Again set If it doesn't exist , Then return to nil; If it exists, get the original value and set the new value
Getrange< The starting position >< End position >
Setrange< The starting position >
2 List
Lpush/rpush ... From the left / Insert one or more values... To the right
Lpop/rpop From the left / Spit out a value on the right . Value at key at , The value of the light key
Rpoplush from key1 Spit a value on the right side of the list , Insert into key2 To the left of the list
Lrange Get elements by index ( From left to right )
Lindex Get elements by index
Llen Get list length
Linsertbefore stay value Insert... At the back newvalue Insert value
Lrem Delete from the left n individual value( From left to right )
Lset take key Subscript to be index Replace the value of with value
3 Set
Sadd Put one or more value Add to key in , Existing neglect
Smembers Take out key Value
Sismember Judgment set key Does it contain value value
Srem... Delete an element in the collection
Scard Returns the number of sets
Srem Spit out a value at random
Srandmember Random spit n Values will not be deleted
Smovevalue Move values in a set from one set to another
Sinter Returns the intersection element of two sets
Sunion Returns the union element of two sets
Sdiff Returns the difference set element of two sets (key1 Medium , barring key2 Of )
4 hash
Hset to key Medium filed Key assignment value
Hget from key in field Take out value
Hmset... Batch settings hash value
Hexists View the hash table key in , Define a domain for field Whether there is
Hkeys List the hash Gather all field
Hvals List the hash All of the collection value
Hincrby Hash table key In the domain filed Value increment of
Hsetnx Hash table key Medium field Is set to value. And only if the domain field non-existent
5 Ordered set zset
Zadd... Put one or more member Elements and score Values are added to the order key in
Zrange[withscores] Return to ordered set key The subscript is in start stop The element band between withscores, You can return the methods together to the result set
Zrangebyscore key minmax[withscores][limit offset count] Return to ordered set key All in score The value is between min and max Among the members of the ordered collection, the members press score Increasing ( From small to large ) Sort
Zrevrangebyscore key maxmin[withscores][limit offset count] From big to small
Zincrby For the elements scores Plus the increment
Zrem Delete the collection , The element that specifies the value
Zcount Count the set , Number of elements in fractional interval
Zrank Returns the rank of the value in the collection , from 0 Start
This article is my previous notes , If I saw it on the Nuggets, it's right , Or myself Cheng Cheng My personal homepage - article - Nuggets This is the only one . If there is anything wrong, you are welcome to point out the problem , I am a little white .
The link of the last article is :Redis6_ Cheng Cheng is Xiaobai's blog -CSDN Blog , This article is a link to the previous article Redis6_ Cheng Cheng is Xiaobai's blog -CSDN Blog Of .
If it is springboot If so, please see springboot Create project _ Cheng Cheng is Xiaobai's blog -CSDN Blog , This is from scratch, not finished springboot, Study together !!!!
边栏推荐
- 【sylar】实战篇-基于 redis 的参数查询服务
- Performance comparison between set and list
- Use Baidu developer tool 4.0 to build a dedicated applet IDE
- ADB environment configuration
- 重要的 SQL Server 函数 - 日期函数
- X Book Keyword Search
- np. unravel_ Index() finds the index value of an element (or group of elements) of the array after being pulled into one dimension. The corresponding index value in the original dimension (or specify
- 高数_第4章__曲线积分_习题解法
- Object locking in relational database transactions
- could only be written to 0 of the 1 minReplication nodes. There are 0 datanode(s) running and 0 node
猜你喜欢

01-Node-Express系统框架搭建(express-generator)

Harmony's Application on the shelves reported an error. The solution of "please use the API of the released version to develop the application and apply for listing"
![[idea] check out master invalid path problem](/img/83/d36362ba314177cd6f1f74f3e922cd.png)
[idea] check out master invalid path problem

Destructor of member function

重要的 SQL Server 函数 - 日期函数

031 log4j log framework

Full resolution of the use of go native plug-ins

王爽汇编语言详细学习笔记三:寄存器(内存访问)

Introduction to this pointer

Elementary level of C language -- while, for, do while
随机推荐
Bio annotation of emotion analysis aste triples extraction
Rendering process, how the code becomes a page (I)
【sylar】框架篇-Chapter21-环境变量模块
Jupyter Notebook安装代码提示功能
[Sylar] practical part - redis based parameter query service
Basic knowledge of network security - password (I)
【sylar】框架篇-Chapter22-辅助模块
Zhejiang University and other recent review papers on deep learning new drug design
22 openwrt uses external kernel and kernel_ config
Is low code the future of development? On low code platform
Select sorting method
Cmake usage base summary
Blooming old trees -- quickly build a map bed application with imageprocessor
pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null
Destructor of member function
全方位分析STEAM和创客教育的差异化
Sort - cardinal sort
Performance comparison between set and list
01 node express system framework construction (express generator)
Information system project manager (2022) - key content: organization level project management, process management, project set management (18)