当前位置:网站首页>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边栏推荐
猜你喜欢

元宇宙:未来我们的每一个日常行为是否都能成为赚钱工具?

KT6368A Bluetooth certification problem_FCC and BQB_CE_KC certification or other instructions

如何写好测试用例

2 用D435i运行VINS-fusion

uniapp横向选项卡(水平滚动导航栏)效果demo(整理)
![[CVA Valuation Training Camp] Financial Modeling Guide - Lecture 1](/img/8b/360df9a9094037dc358cb21c60cdc8.png)
[CVA Valuation Training Camp] Financial Modeling Guide - Lecture 1

Security software Avast and Symantec NortonLifeLock merge with UK approval, market value soars 43%

数据类型及输入输出初探(C语言)

【CVA估值训练营】财务建模指南——第一讲

论文解读( AF-GCL)《Augmentation-Free Graph Contrastive Learning with Performance Guarantee》
随机推荐
子连接中的参数传递
lua 如何 实现一个unity协程的工具
[LeetCode] Summary of Matrix Simulation Related Topics
机器学习(公式推导与代码实现)--sklearn机器学习库
对写作的一些感悟
what?测试/开发程序员要被淘汰了?年龄40被砍到了32?一瞬间,有点缓不过神来......
电子行业MES管理系统的主要功能与用途
Statistical words (DAY 101) Huazhong University of Science and Technology postgraduate examination questions
OpenCV:10特征检测
matlab中rcosdesign函数升余弦滚降成型滤波器
golang 协程的实现原理
关于使用read table 语句
资深游戏建模师告知新手,游戏场景建模师必备软件有哪些?
建模师经验分享:模型学习方法
"Relish Podcast" #397 The factory manager is here: How to use technology to empower the law?
【CVA估值训练营】财务建模指南——第一讲
Day118. Shangyitong: order list, details, payment
中日颜色风格
三大技巧让你成功入门3D建模,零基础小白必看
Cython