脚本宝典收集整理的这篇文章主要介绍了Redis的Node.js扩展包 node_redis 示例代码,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。node_redis 可让你在 Node.js 编程环境中连接并操作 Redis 上的数据。 示例代码
VAR redis = require("redis"),
client = redis.createClient();
client.on("error", function (err) {
console.LOG("Error " + err);
});
client.set("string key", "string val", redis.PRint);
client.hset("hash key", "hashtest 1", "some value", redis.print);
client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
client.hkeys("hash key", function (err, replies) {
console.log(replies.length + " replies:");
replies.foreach(function (reply, i) {
console.log(" " + i + ": " + reply);
});
client.quIT();
});
觉得可用,就经常来吧!脚本宝典 欢迎评论哦!node_redis 示例代码 Redis扩展包 node_redis 示例代码 ,巧夺天工,精雕玉琢。小宝典献丑了!
以上是脚本宝典为你收集整理的Redis的Node.js扩展包 node_redis 示例代码全部内容,希望文章能够帮你解决Redis的Node.js扩展包 node_redis 示例代码所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。