当前位置:网站首页>Redis command
Redis command
2022-07-03 06:48:00 【Numerous and falling】
install
redis From entry to proficiency
windows Installation tutorial
Install the package version into the decompression directory and enter :
redis-server --service-install redis.windows.conf --loglevel verbose -- install
redis-server --service-start -- start-up
redis-server --service-stop -- close
command
string
set name cxx
get name
getrange name 0 2 Intercept string from subscript 0 Start to subscript 2 end
getset name new_cxx Set new value , Return old value
mset key1 key2 Batch settings
mget key1 key2 Batch acquisition
setnx key value Insert if it doesn't exist (not exists)
setex key time value Expiration time (expire)
setrange key index value from index Start using value Replace the original value
incr age Increasing , In steps of 1
incrby age 10 Increasing , In steps of 10
decr age Decline , In steps of 1
decrby age 10 Decline , In steps of 10
incrbyfloat age 0.5 Increasing floating point number
append Additional
strlen length
getbit/setbit/bitcount/bitop Bit operation
hash
hset myhash name cxx
hget myhash name
hmset myhash name cxx age 25 note "i am notes"
hmget myhash name age note
hgetall myhash obtain myhash All of the key value
hexists myhash name Whether there is
hsetnx myhash score 100 There is no modification , Insert if it doesn't exist
hincrby myhash id 1 Increasing
hdel myhash name Delete
hkeys myhash Take only key
hvals myhash Take only value
hlen myhash length
list
lpush mylist a b c Insert left
rpush mylist x y z Insert right
lrange mylist 0 -1 Data set
lpop mylist Pop up elements
rpop mylist Pop up elements
llen mylist length
lrem mylist count value Delete
lindex mylist 2 Specifies the value of the index
lset mylist 2 n Index settings
ltrim mylist 0 4 Delete key
linsert mylist before a Insert
linsert mylist after a Insert
rpoplpush list list2 List of data transferred
set
sadd myset redis
smembers myset Data set
srem myset set1 Delete
sismember myset set1 Determines whether an element is in the set
scard key_name Number
sdiff | sinter | sunion operation : Operations between sets : Difference set | intersection | Combine
srandmember Get the elements in the collection at random
spop Pop an element from the collection
zset
zadd zset 1 one
zadd zset 2 two
zadd zset 3 three
zincrby zset 1 one Increase the score
zscore zset two Get points
zrange zset 0 -1 withscores Range value
zrangebyscore zset 10 25 withscores The value of the specified range
zrangebyscore zset 10 25 withscores limit 1 2 Pagination
Zrevrangebyscore zset 10 25 withscores The value of the specified range
zcard zset Element quantity
Zcount zset Get the number of elements in the specified score range
Zrem zset one two Delete one or more elements
Zremrangebyrank zset 0 1 Delete elements... According to the ranking range
Zremrangebyscore zset 0 1 Delete elements... According to the score range
Zrank zset 0 -1 The element with the lowest score is ranked as 0
Zrevrank zset 0 -1 The element with the highest score is ranked as 0
Zinterstore
zunionstore rank:last_week 7 rank:20150323 rank:20150324 rank:20150325 weights 1 1 1 1 1 1 1
边栏推荐
- How to scan when Canon c3120l is a network shared printer
- [Code] occasionally take values, judge blanks, look up tables, verify, etc
- Mysql5.7 group by error
- SQL implementation merges multiple rows of records into one row
- Pytorch exercise items
- IE browser flash back, automatically open edge browser
- Personally design a highly concurrent seckill system
- Abstract learning
- Docker advanced learning (container data volume, MySQL installation, dockerfile)
- [5g NR] UE registration process
猜你喜欢

New knowledge! The virtual machine network card causes your DNS resolution to slow down

The 10000 hour rule won't make you a master programmer, but at least it's a good starting point

数值法求解最优控制问题(一)——梯度法
![[classes and objects] explain classes and objects in simple terms](/img/41/250457530880dfe3728432c2ccd50b.png)
[classes and objects] explain classes and objects in simple terms

Selenium - by changing the window size, the width, height and length of different models will be different

Golang operation redis: write and read kV data

Summary of remote connection of MySQL

Docker advanced learning (container data volume, MySQL installation, dockerfile)

Ruoyi interface permission verification

熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?
随机推荐
Ruoyi interface permission verification
Summary of remote connection of MySQL
A letter to graduating college students
Understand software testing
Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"
[LeetCode]404. Sum of left leaves
第8章、MapReduce 生产经验
数值法求解最优控制问题(一)——梯度法
【5G NR】UE注册流程
Golang operation redis: write and read kV data
Operation principle of lua on C: Foundation
Class and object summary
opencv
Install VM tools
[leetcode] day93 - intersection of two arrays II
Interface test weather API
Request weather interface format, automation
Pytest attempts to execute the test case without skipping, but the case shows that it is all skipped
ruoyi接口权限校验
Opencv mouse and keyboard events