1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-11 22:42:42 +03:00
Files
node-redis/examples/subqueries.js
Ruben Bridgewater b2613b2270 test fixup
2017-05-06 08:16:19 +02:00

20 lines
458 B
JavaScript

'use strict'
// Sending commands in response to other commands.
// This example runs 'type' against every key in the database
//
const client = require('redis').createClient()
client.keys('*', (err, keys) => {
if (err) throw err
keys.forEach((key, pos) => {
client.type(key, (err, keytype) => {
if (err) throw err
console.log(`${key } is ${keytype}`)
if (pos === (keys.length - 1)) {
client.quit()
}
})
})
})