Skip to content

Instantly share code, notes, and snippets.

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