当前位置:网站首页>node uses redis
node uses redis
2022-08-05 00:20:00 【Xu Tongbao】
redis download:
https://github.com/tporadowski/redis/releases
Using from the command line:
Access redis through node:
const redis = require('redis')const redisClient = redis.createClient()redisClient.on('error', (err) => console.log('Redis redisClient Error', err))redisClient.connect()module.exports = {redisClient}
Pass the interface test:
//redisconst toolsRedis = async(req, res) => {const a = await redisClient.get('a')res.send({code: 200,data: {a},message: 'redis successful'})}
Query all keys:
keys *
Clear all keys:
flushall
边栏推荐
猜你喜欢
随机推荐
MongoDB permission verification is turned on and mongoose database configuration
SQL关联表更新
"Relish Podcast" #397 The factory manager is here: How to use technology to empower the law?
tiup telemetry
子连接中的参数传递
统计单词(DAY 101)华中科技大学考研机试题
典型相关分析CCA计算过程
00、数组及字符串常用的 API(详细剖析)
在线中文姓名生成工具推荐
【LeetCode】滑动窗口题解汇总
软件测试面试题:BIOS, Fat, IDE, Sata, SCSI, Ntfs windows NT?
gorm的Raw与scan
软件测试面试题:软件都有多少种分类?
KT6368A Bluetooth certification problem_FCC and BQB_CE_KC certification or other instructions
Raw and scan of gorm
Implementation principle of golang coroutine
What is next-generation modeling (with learning materials)
[230]连接Redis后执行命令错误 MISCONF Redis is configured to save RDB snapshots
After another 3 days, I have sorted out 90 NumPy examples, and I can't help but bookmark it!
MongoDB权限验证开启与mongoose数据库配置