当前位置:网站首页>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 matlab modifies default settings
- 远端rostopic的本地rviz调用及显示
- How can the server set up multiple interfaces and install IIS? Tiantian gives you the answer!
- 每日刷题记录 (十一)
- Heap sort and priority queue
- 【类和对象】深入浅出类和对象
- 【开源项目推荐-ColugoMum】这群本科生基于国产深度学习框架PaddlePadddle开源了零售行业解决方案
- 方差迭代公式推导
- [C /vb.net] convert PDF to svg/image, svg/image to PDF
- 100000 bonus is divided up. Come and meet the "sister who braves the wind and waves" among the winners
猜你喜欢

scroll-view指定滚动元素的起始位置

Example of joint use of ros+pytoch (semantic segmentation)

熊市里的大机构压力倍增,灰度、Tether、微策略等巨鲸会不会成为'巨雷'?

HMS core helps baby bus show high-quality children's digital content to global developers

The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list

Operation principle of lua on C: Foundation

Dbnet: real time scene text detection with differentiable binarization

远端rostopic的本地rviz调用及显示

Journal quotidien des questions (11)

10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”
随机推荐
Reinstalling the system displays "setup is applying system settings" stationary
卡特兰数(Catalan)的应用场景
[Code] if (list! = null & list. Size() > 0) optimization, set empty judgment implementation method
Integration test practice (1) theoretical basis
POI dealing with Excel learning
【code】if (list != null && list.size() > 0)优化,集合判空实现方式
Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
【C#/VB.NET】 将PDF转为SVG/Image, SVG/Image转PDF
Judge whether the date time exceeds 31 days
Page text acquisition
UNI-APP中条件注释 实现跨段兼容、导航跳转 和 传参、组件创建使用和生命周期函数
数值法求解最优控制问题(一)——梯度法
致即将毕业大学生的一封信
IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库
New knowledge! The virtual machine network card causes your DNS resolution to slow down
Cannot get value with @value, null
【类和对象】深入浅出类和对象
conda和pip的区别
服务器如何设置多界面和装IIS呢?甜甜给你解答!
Code management tools