当前位置:网站首页>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
边栏推荐
猜你喜欢
Integration test practice (1) theoretical basis
vmware虚拟机C盘扩容
Time format record
[untitled]
2022 East China Normal University postgraduate entrance examination machine test questions - detailed solution
Example of joint use of ros+pytoch (semantic segmentation)
The dynamic analysis and calculation of expressions are really delicious for flee
【开源项目推荐-ColugoMum】这群本科生基于国产深度学习框架PaddlePadddle开源了零售行业解决方案
YOLOV3学习笔记
scroll-view指定滚动元素的起始位置
随机推荐
Mysql5.7 group by error
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
【C#/VB.NET】 将PDF转为SVG/Image, SVG/Image转PDF
2022-06-23 VGMP-OSPF-域间安全策略-NAT策略(更新中)
Cannot get value with @value, null
卡特兰数(Catalan)的应用场景
Basic teaching of crawler code
Yolov2 learning and summary
The 10000 hour rule won't make you a master programmer, but at least it's a good starting point
【LeetCode】Day93-两个数组的交集 II
How matlab modifies default settings
YOLOV2学习与总结
IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库
These two mosquito repellent ingredients are harmful to babies. Families with babies should pay attention to choosing mosquito repellent products
Selenium - 改变窗口大小,不同机型呈现的宽高长度会不一样
机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
scroll-view指定滚动元素的起始位置
2022年华东师范大学计科考研复试机试题-详细题解
Asynchronous programming: async/await in asp Net
How to scan when Canon c3120l is a network shared printer