1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Add subqueries example.

This commit is contained in:
Matt Ranney
2010-11-03 14:04:53 -07:00
parent 81fc8516e4
commit 95e60006f6

15
examples/subqueries.js Normal file
View File

@@ -0,0 +1,15 @@
// Sending commands in response to other commands.
// This example runs "type" against every key in the database
//
var client = require("redis").createClient();
client.keys("*", function (err, keys) {
keys.forEach(function (key, pos) {
client.type(key, function (err, keytype) {
console.log(key + " is " + keytype);
if (pos === (keys.length - 1)) {
client.quit();
}
});
});
});