Created
January 14, 2017 21:48
-
-
Save JeffML/30a837679a82ec38847b1ad48fc1d3b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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