Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const updateAmount = (req, res) => {
- let result;
- mongoose.connect(mongourl,options)
- .then(async ()=>{
- result=await bar.find({ name: req.body.name }, (err,result) => {
- if (err)
- throw err;
- console.log(`this is result: \n ${result}`);
- console.log('name:'+req);
- res.end('done');
- });
- })
- .catch(err => {
- console.error('some error occurred', err)
- res.end(err.message);
- })
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement