Skip to content

Instantly share code, notes, and snippets.

@robophil
Created April 7, 2017 16:18
Show Gist options
  • Save robophil/a3dee495004606ec6009dbf126b79ff2 to your computer and use it in GitHub Desktop.
Save robophil/a3dee495004606ec6009dbf126b79ff2 to your computer and use it in GitHub Desktop.
laju
Account.find({help:'ph'}).then(data=>data.forEach(account=>{Promise.all([ProvideHelp.findOne({account:account.id}),GetHelp.findOne({account:account.id})]).then(data=>{var ph=data[0],gh=data[1];if(!ph&&!gh){ProvideHelp.create({account:account.id,level:account.level}).then(d=>console.log(d))}})}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment