var redis = require('redis'), RDS_PORT = 6389, //端口号 RDS_HOST = '127.0.0.1', //服务器IP RDS_PWD = '88888888888888', //密码 RDS_OPTS = {}, //设置项 rclient = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS); rclient.auth(RDS_PWD,function(){ console.log('redis通过认证'); }); //redis数据库 rclient.set('key','1');//赋值 rclient.expire('key',60);//60秒自动过期
nodejs里面redis设置过期时间
最新推荐文章于 2024-03-19 10:40:37 发布