You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
614 B
18 lines
614 B
14 years ago
|
var redis = require("redis"),
|
||
|
client = redis.createClient();
|
||
|
|
||
14 years ago
|
client.on("error", function (err) {
|
||
|
console.log("Redis connection error to " + client.host + ":" + client.port + " - " + err);
|
||
|
});
|
||
|
|
||
14 years ago
|
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);
|
||
14 years ago
|
});
|
||
14 years ago
|
client.quit();
|
||
14 years ago
|
});
|