当前位置:网站首页>node使用redis
node使用redis
2022-08-05 00:11:00 【徐同保】
redis下载:
https://github.com/tporadowski/redis/releases
通过命令行使用:
通过node访问redis:
const redis = require('redis')
const redisClient = redis.createClient()
redisClient.on('error', (err) => console.log('Redis redisClient Error', err))
redisClient.connect()
module.exports = {
redisClient
}
通过接口测试:
//redis
const toolsRedis = async (req, res) => {
const a = await redisClient.get('a')
res.send({
code: 200,
data: {
a
},
message: 'redis成功'
})
}
查询所有key:
keys *
清除所有key:
flushall
边栏推荐
- MongoDB permission verification is turned on and mongoose database configuration
- How to automatically push my new articles to my fans (very simple, can't learn to hit me)
- uinty lua 关于异步函数的终极思想
- 【Unity编译器扩展之进度条】
- MongoDB权限验证开启与mongoose数据库配置
- Uniapp dynamic sliding navigation effect demo (finishing)
- 简单的顺序结构程序(C语言)
- 导入JankStats检测卡帧库遇到问题记录
- 【LeetCode】矩阵模拟相关题目汇总
- 美团二面:Redis与MySQL双写一致性如何保证?
猜你喜欢
matlab中rcosdesign函数升余弦滚降成型滤波器
Essential knowledge for entry-level 3D game modelers
uniapp sharing function - share to friends group chat circle of friends effect (sorting)
Huggingface入门篇 II (QA)
Ab3d.PowerToys and Ab3d.DXEngine Crack
Getting started with 3D modeling for games, what modeling software can I choose?
简单的顺序结构程序(C语言)
数据类型-整型(C语言)
【云原生--Kubernetes】调度约束
电赛必备技能___定时ADC+DMA+串口通信
随机推荐
Xiaohei leetcode surfing: 94. Inorder traversal of binary tree
对写作的一些感悟
typeScript - Partially apply a function
Couple Holding Hands [Greedy & Abstract]
Privacy Computing Overview
Day118. Shangyitong: order list, details, payment
软件质量评估的通用模型
软件开发工具的技术要素
Metasploit-域名上线隐藏IP
英特尔WiFi 7产品将于2024年亮相 最高速度可达5.8Gbps
情侣牵手[贪心 & 抽象]
Modelers experience sharing: model study method
2022年华数杯数学建模
what?测试/开发程序员要被淘汰了?年龄40被砍到了32?一瞬间,有点缓不过神来......
Uniapp dynamic sliding navigation effect demo (finishing)
How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer
招标公告 | 海纳百创公众号运维项目
【CVA估值训练营】财务建模指南——第一讲
Some thoughts on writing
测试经理要不要做测试执行?