Skip to content

Instantly share code, notes, and snippets.

@stockholmux
Created May 17, 2018 18:16
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 stockholmux/cf558b04180986916aabfe62d9d3dba6 to your computer and use it in GitHub Desktop.
Save stockholmux/cf558b04180986916aabfe62d9d3dba6 to your computer and use it in GitHub Desktop.
client.multi([
["GETBIT", "article1:today", 123],
["GETBIT", "article2:today", 123],
["GETBIT", "article3:today", 123]
]).exec((err, hits) => {
let total = hits.reduce(function(prev, cur) {
return prev + cur;
}, 0);
console.log(total); // 0, 1, 2 or 3
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment