1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00

Update example.

This commit is contained in:
Matt Ranney
2010-09-17 11:26:46 -07:00
parent 12542e4ccd
commit 78cb4105ca
2 changed files with 34 additions and 36 deletions

View File

@@ -2,19 +2,15 @@ var redis = require("redis"),
client = redis.createClient();
client.on("connect", function () {
client.set("string key", "string val", function (err, results) {
console.log("SET: " + results);
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.end();
});
client.hset("hash key", "hashtest 1", "should be a hash", function (err, results) {
console.log("HSET: " + results);
});
client.hset(["hash key", "hashtest 2", "should be a hash"], function (err, results) {
console.log("HSET: " + results);
});
client.hkeys("hash key", function (err, results) {
console.log("HKEYS: " + results);
process.exit();
});
client.set("some key", "some val");
client.set(["some other key", "some val"]);
});