redis默认端口:6379
redis
https://www.npmjs.com/package/redis
npm install redis
使用 redis
原生 redis怎么写,nodejs中 redis就怎么写
const redis = require('redis');
const client = redis.createClient(6379, 'localhost');
client.set('name', 'longwen', redis.print);
client.hset('user', 'name', 'longwen', redis.print);
client.hgetall('user', (err ,keys) => {
console.log(keys)
}, redis.print);