当前位置:网站首页>Redis常用命令
Redis常用命令
2022-06-22 10:41:00 【dhjywe】
1.字符串的基本操作
# 写数据
set key values
set name Tom
# 设置多个键
mset x 1 y 2 z 3
mget x y z
# 不修改重复的键
setnx name top
这样以后其他人无法修改他
# 设置键的有效期
setex key time value(语法格式)
ep:setex name 10 wei(设置10s时间有效期)
# 获取键值字符串的长度
strlen name
# 设置新键获取旧值
> GETSET db mongo
> nil # 没有旧值返回nil
> get db
> mongo
> GETSET db redis
> mongo # 返回旧值
> get db
> redis
2.数字类型的操作
set count 90
incr count ## 自增1
decr count ## 自减1
incrby count 10 ## 自增10
边栏推荐
- Laravel development article URL generator
- xlrd.biffh.XLRDError: Excel xlsx file; not supported 解决办法
- 爱可可AI前沿推介(6.22)
- 定金预售的规则思路详解
- 批量创建/删除文件、文件夹、修改文件名 后缀名
- AttributeError: module ‘skimage. draw‘ has no attribute ‘circle‘
- 每日一题day5-1636. 按照频率将数组升序排序
- scrapy.Request() 的 meta参数 数据的传递
- [deep learning] tensorflow, danger! Google itself is the one who abandoned it
- Isn't this another go bug?
猜你喜欢

Byte 3: do you know what Eureka is?

Cache penetration tool "Bloom filter"

论文精读:Generative Adversarial Imitation Learning(生成对抗模仿学习)

After using Matplotlib for so long, I didn't know that the data could move

Inftnews | view: market cooling or opportunities for NFT applications

In 2022, IPv6 deployment and application will be further promoted. How can we comprehensively realize security upgrading and transformation?

关于 GIN 的路由树

Duxiaoyong, head of virtual teaching and Research Office of database course: Based on the major needs of domestic databases, explore a new mode of course system construction

WordPress like hooks and filters in laravel

Laravel 中类似 WordPress 的钩子和过滤器
随机推荐
一次特殊的文件上传
LeetCode Algorithm 21. 合并两个有序链表
Web Configuration of Visual Studio Code
Opencv人脸识别之发送QQ邮箱
Quel est le risque de divulgation d'un certificat de signature de code?
Gartner said: cloud database is developing strongly, but local database is still full of vitality
爱可可AI前沿推介(6.22)
JG_fx_20220620
Cache penetration tool "Bloom filter"
无线802.1x认证简介及配置方法
LeetCode Algorithm 剑指 Offer 18. 删除链表的节点
社区文章|MOSN 构建 Subset 优化思路分享
PHP开发的网站,如何实现批量打印快递单的功能?
中坚力量!优炫软件入选2022年中国数字安全百强
Backbone! Youxuan software was selected as one of the top 100 digital security companies in China in 2022
Use of libevent
Zero‐Copy API
MySQL使用SQL语句新增字段、删除字段
[deep learning] tensorflow, danger! Google itself is the one who abandoned it
php 数据库 mysql提问