Skip to content

Instantly share code, notes, and snippets.

@jrf0110
Last active August 29, 2015 14:16
Show Gist options
  • Save jrf0110/20d4474cee8fb098b78d to your computer and use it in GitHub Desktop.
Save jrf0110/20d4474cee8fb098b78d to your computer and use it in GitHub Desktop.
db.user_invoices.findAysnc({
status: 'pending'
, billing_period_begin: period.startDate
, billing_period_end: period.endDate
})
.catch( function( error ){ throw error; });
.map( function( invoice ){
return invoices.create( invoice )
.sendEmailAsync()
.error( function( error ){
errors.push( error );
});
}, { concurrency: CONCURRENCY })
.then( function(){
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment