Skip to content

Instantly share code, notes, and snippets.

@keviocastro
Created November 5, 2020 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keviocastro/5617c370ca49d5d2160969f9a95c944f to your computer and use it in GitHub Desktop.
Save keviocastro/5617c370ca49d5d2160969f9a95c944f to your computer and use it in GitHub Desktop.
var redis = require('redis');
var client = redis.createClient(6379, 'localhost', { no_ready_check: true });
client.keys('*-msgs', function (err, keys) {
if (err) return console.log(err);
keys.forEach((key) => {
client.lrange(key, 0, -1, (err, items) => {
if (err) throw err
items.forEach((item, i) => {
console.log(key + ':' + i + ':' + item)
})
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment