Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // list of 'employee' objects
- var objs = getList();
- Promise.all(objs.map(function(o) {
- // use 'node-orm2'.find() or 'node-mysql'.query()
- // if no similar exists, return it (some where condition)
- // problem is find() and query() have their own 'callback'
- // where do I return 'o' for the 'Array.map()'?
- }).then(function(filteredObjs) {
- // do whatever I want
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement