Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const updateAmount = (req, res) => {
  2. let result;
  3.  
  4. mongoose.connect(mongourl,options)
  5. .then(async ()=>{
  6. result=await bar.find({ name: req.body.name }, (err,result) => {
  7. if (err)
  8. throw err;
  9. console.log(`this is result: \n ${result}`);
  10. console.log('name:'+req);
  11. res.end('done');
  12. });
  13. })
  14. .catch(err => {
  15. console.error('some error occurred', err)
  16. res.end(err.message);
  17. })
  18.  
  19.  
  20. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement