Skip to content

Instantly share code, notes, and snippets.

@mickhansen
Created January 19, 2015 18:58
Show Gist options
  • Save mickhansen/e75bc0b885e746892974 to your computer and use it in GitHub Desktop.
Save mickhansen/e75bc0b885e746892974 to your computer and use it in GitHub Desktop.
var Promise = require('bluebird');
Promise.reduce(queries, function (results, query) {
return sequelize.query(query, null, {raw: true, plain: true}).then(function (result) {
return results.concat([result]);
});
}, []).then(function (results) {
console.log("results");
}).catch(function (err) {
console.error("Error": err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment