Skip to content

Instantly share code, notes, and snippets.

@JeffML
Created January 14, 2017 21:48
Show Gist options
  • Save JeffML/30a837679a82ec38847b1ad48fc1d3b8 to your computer and use it in GitHub Desktop.
Save JeffML/30a837679a82ec38847b1ad48fc1d3b8 to your computer and use it in GitHub Desktop.
const choices = [
[['VANILLA'], ['coconut flakes', 'pecans'], ['marshmallow']],
[['CHOCOLATE'], ['pecans'], ['chocolate']],
[['STRAWBERRY', 'VANILLA'], ['pineapple', 'coconut flakes'], ['marshmallow']],
[['STRAWBERRY'], ['pecans'], ['maple']],
[['VANILLA'], ['coconut flakes', 'pineapple'], ['chocolate']],
[['CHOCOLATE, STRAWBERRY'], ['pineapple', 'pecans'], ['butterscotch']],
];
const keys = _.map(choices, c => {
return hash(c);
});
db.query('choice/by_key', {
keys: keys,
include_docs: false,
}, function (err, result) {
if (err) {
return console.error(err);
}
_.each(result.rows, (r, i) => {
console.log(`${choices[i]} tastes ${r.value}`);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment