Skip to content

Commit

Permalink
Add subqueries example.
Browse files Browse the repository at this point in the history
  • Loading branch information
mranney committed Nov 3, 2010
1 parent 81fc851 commit 95e6000
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/subqueries.js
@@ -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();
}
});
});
});

0 comments on commit 95e6000

Please sign in to comment.