1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/examples/subqueries.js
Ruben Bridgewater f1a7bcd735 chore: use standard
2017-05-06 07:06:52 +02:00

20 lines
472 B
JavaScript

'use strict'
// 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) {
if (err) throw err
keys.forEach(function (key, pos) {
client.type(key, function (err, keytype) {
if (err) throw err
console.log(key + ' is ' + keytype)
if (pos === (keys.length - 1)) {
client.quit()
}
})
})
})