当前位置:网站首页>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边栏推荐
- 子连接中的参数传递
- 【七夕情人节特效】-- canvas实现满屏爱心
- How to burn the KT148A voice chip into the chip through the serial port and the tools on the computer
- The applicable scenarios and common product types of the KT148A electronic voice chip ic solution
- Basic web in PLSQL
- 论文解读( AF-GCL)《Augmentation-Free Graph Contrastive Learning with Performance Guarantee》
- 图解 Canvas 入门
- [Happy Qixi Festival] How does Nacos realize the service registration function?
- IDEA 文件编码修改
- 翁恺C语言程序设计网课笔记合集
猜你喜欢
随机推荐
【数据挖掘概论】数据挖掘的简单描述
2022 Niu Ke Summer Multi-School Training Camp 5 (BCDFGHK)
性能测试如何准备测试数据
VMware NSX 4.0 -- 网络安全虚拟化平台
[Cloud Native--Kubernetes] Pod Controller
Cython
软件开发工具的技术要素
golang 协程的实现原理
矩阵数学原理
Basic web in PLSQL
【unity编译器扩展之模型动画拷贝】
Xiaohei leetcode surfing: 94. Inorder traversal of binary tree
什么是次世代建模(附学习资料)
Security software Avast and Symantec NortonLifeLock merge with UK approval, market value soars 43%
Nuclei (2) Advanced - In-depth understanding of workflows, Matchers and Extractors
Mysql_12 多表查询
【Unity编译器扩展之进度条】
oracle创建表空间
Brainstorm: Complete Backpack
资深游戏建模师告知新手,游戏场景建模师必备软件有哪些?

![Couple Holding Hands [Greedy & Abstract]](/img/7d/1cafc000dc58f1c5e2e92150be7953.png)





