当前位置:网站首页>Redis string structure command
Redis string structure command
2022-07-25 09:33:00 【yu-yuan】
character string
// String type access
set key value ( After add xx You can modify this key Of value)
get key
Preceding value Output And replace it with value
getset key value
flushdb Clear all... In the current database keyKEY operation
| Query existing key | |
| Accurate check | keys title |
| Fuzzy check | |
| * With any number of characters | keys * |
| [ ] Wildcard a character in parentheses | keys titl[ey] |
| ? Pass on a single character | keys tit?e |
| Take a random sample of key | random key |
| Look at this. key The type of | type key |
| Judge a certain key Whether there is | exists key |
| Delete this key | del key |
| change key name ( If the changed new name already exists , Continuing to rename will cover the previous key) | rename key newkey |
| Judge that it already exists key change key name It will not affect the existing key value | renamenx key neykey |
| Inquire about key The expiration time of ( Has expired -1 Never expire -1) | ttl key ( Return a time m) |
| Set up key Effective time of | expire key time ( second ) pexpire key time ( millisecond ) pttl ( Return time in milliseconds ) persist key ( Permanent validity ) |
| Set more than one at a time key | mset key1 value1 key2 value2 |
| Query multiple keys at once | mget key1 key2 key 3 |
| Replace in string Some character | setrange key limit value for example :name:redis setrange name 2 ! name:re!is If the offset subscript does not exist , Will take the initiative to supplement \x00 In characters Number Add |
| String append | append key @@ |
| Get the characters from start to end | getrange key start shop
|
| Self increasing | incr key incrby key After add by ( Add more at a time ) incebyfloat key ( Increase by floating point number ) |
| Self reduction | decr key decrby key After add by ( Add and subtract more at a time ) decrbyfloat key ( Reduce by floating point number ) |
| Bitmap | setbit key offset( Subscript ) value(1,0) offset Too big Will be filled in the middle 0 offset Maximum yes max offset 2 Of 32 The power minus 1 512M |
![]() | |
![]() | |
redis The default is 16 A database ( The default is database 0)
Switch database
select ?
Redis string Optional parameters
set key value ex ( second ) px ( millisecond )
ex px All optional parameters You can write without writing
边栏推荐
- C language and SQL Server database technology
- UI——无限轮播图和分栏控制器
- How to deploy the jar package to the server? Note: whether the startup command has nohup or not has a lot to do with it
- C#语言和SQL Server数据库技术
- 浏览器访问swagger失败,显示错误ERR_UNSAFE_PORT
- TCP网络应用程序开发流程
- main函数的一些操作
- 【代码源】每日一题 非递减01序列
- Mongodb exploration phase [easy to understand]
- Two Sum
猜你喜欢
随机推荐
sqli-labs Basic Challenges Less1-10
Notes on in-depth analysis of C language 2
Week小结
机器学习 —— Sklearn包中StandardScaler()、transform()、fit()的详细介绍
神经网络方法——美国波士顿房价(回归问题)
卷积神经网络的兴趣简单介绍
动态添加多tab,并初始化每个tab页面
[HCTF 2018]admin
Go基础4
数据预处理
数据库操作语言(DML)
Swagger2 shows that there is a problem with the get interface, which can be solved with annotations
Go基础1
TCP网络应用程序开发流程
Flex 布局语法与用例
How to deploy the jar package to the server? Note: whether the startup command has nohup or not has a lot to do with it
[GPLT] 2022 大众情人(floyd)
[HCTF 2018]admin
Redis set 结构命令
【代码源】每日一题 三段式












