当前位置:网站首页>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
边栏推荐
- 论文笔记 VSALM 文献综述《A Comprehensive Survey of Visual SLAM Algorithms》
- VMware virtual machine C disk expansion
- 【code】if (list != null && list.size() > 0)优化,集合判空实现方式
- [Code] if (list! = null & list. Size() > 0) optimization, set empty judgment implementation method
- 爬虫代码基础教学
- The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
- The difference between CONDA and pip
- Yolov3 learning notes
- How to scan when Canon c3120l is a network shared printer
- 保险公司怎么查高血压?
猜你喜欢

Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"

2022年华东师范大学计科考研复试机试题-详细题解

Scripy learning

Operation principle of lua on C: Foundation

数值法求解最优控制问题(一)——梯度法

DBNet:具有可微分二值化的实时场景文本检测

Scroll view specifies the starting position of the scrolling element

Time format record

利用C#实现Pdf转图片

“我为开源打榜狂”第一周榜单公布,160位开发者上榜
随机推荐
How can the server set up multiple interfaces and install IIS? Tiantian gives you the answer!
[5g NR] UE registration process
Class and object summary
Unit test framework + Test Suite
Pytorch exercise items
第8章、MapReduce 生产经验
POI dealing with Excel learning
VMware virtual machine C disk expansion
The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
Ruoyi interface permission verification
机械观和系统观的科学思维方式各有什么特点和作用
Code management tools
【code】if (list != null && list.size() > 0)优化,集合判空实现方式
How to migrate or replicate VMware virtual machine systems
2022 CISP-PTE(三)命令执行
The win7 computer can't start. Turn the CPU fan and stop it
C2338 Cannot format an argument. To make type T formattable provide a formatter<T> specialization:
Mysql5.7 group by error
Simple understanding of bubble sorting
JMeter linked database