Monday, 22 May 2017

how to count the number of records of particular username in database in nodejs & expressjs

i want to count the number of records of particular username in mlab database.when i adding next record related to that
username,need to display the number of record.
how can i do this using api :
router.post("/addDonate", function(req, res, next){ console.log(req.body); var newDonaterecord = new Donaterecord(req.body); console.log(newDonaterecord); newDonaterecord.save(function (err, doc) { if (err){ return res.json(err);} else{ return res.status(200);} console.log('Saved Doc'+ doc); }); res.json('Donation Details Added Successfully!!!'); });



via Poonam

No comments:

Post a Comment