当前位置:网站首页>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 !!!!
边栏推荐
- Advanced architects, 16 common principles of microservice design and Governance
- Reading of papers on "towards generative aspect based sentimental analysis"
- (克隆虚拟机步骤)
- 网络安全基本知识——密码(一)
- 物联网工业串口转WiFi模块 无线路由WiFi模块的选型
- Ma Yi, Shen Xiangyang, Cao Ying's latest AI overview is hot! It took 3 months to build, netizens: required papers
- Use Baidu developer tool 4.0 to build a dedicated applet IDE
- printf()打印char* str
- Basic knowledge of network security - password (I)
- X Book Keyword Search
猜你喜欢

DNS series (III): how to avoid DNS spoofing

Information system project manager (2022) - key content: Project Portfolio Management (19)

Reading of papers on "towards generative aspect based sentimental analysis"

pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null

高数_第4章__曲线积分_习题解法

Odoo action analysis (action.client, action.act_window, action.server)

Study notes of Gu Yujia on July 27, 2022

启发国内学子学习少儿机器人编程教育

Password key hard coding check

将数据库拿到的数据渲染到elementUI 中的table中去
随机推荐
Cmake usage base summary
Practice and thinking of AI standardization engine in pink client
【sylar】框架篇-Chapter20-守护进程模块
【sylar】框架篇-Chapter15-Stream 模块
Warning: file already exists but should not: c:\users\workmai\appdata\local\temp appears when Python packages exe\_ MEI13
[Sylar] framework Chapter 8 timer module
重要的 SQL Server 函数 - 其他函数
Reading of papers on "towards generative aspect based sentimental analysis"
Odoo action analysis (action.client, action.act_window, action.server)
DNS series (III): how to avoid DNS spoofing
Machine learning and deep learning -- normalization processing
[Sylar] framework Chapter 22 auxiliary module
启发国内学子学习少儿机器人编程教育
Ma Yi, Shen Xiangyang, Cao Ying's latest AI overview is hot! It took 3 months to build, netizens: required papers
alter和confirm,prompt的区别
Geely AI interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]
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
bubble sort
[II. Mobile web page development] 2D & 3D conversion and animation, mobile terminal layout, responsive layout
031 log4j log framework