Here is my code:app.get('/api/getUsers',(req,res)=>{ User.find({landlord:req.query.id}).exec((err,users)=>{ if (err) return res.status(400).send(err) console.log(users) //works upto here users.getTotal((err,updateduser)=>{ if (err) return res.status(400).send(err) res.status(200).send(updateduser) }) }) }) AnduserSchema.methods.getTotal=function(cb){ var user=this; console.log(user._id) }
Submitted July 23, 2020 at 11:19AM by nirmity
No comments:
Post a Comment