1 var redis = require("redis"),
2 client = redis.createClient();
4 client.on("error", function (err) {
5 console.log("error event - " + client.host + ":" + client.port + " - " + err);
8 client.set("string key", "string val", redis.print);
9 client.hset("hash key", "hashtest 1", "some value", redis.print);
10 client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
11 client.hkeys("hash key", function (err, replies) {
13 return console.error("error response - " + err);
16 console.log(replies.length + " replies:");
17 replies.forEach(function (reply, i) {
18 console.log(" " + i + ": " + reply);
22 client.quit(function (err, res) {
23 console.log("Exiting from quit command.");