I am using this code but somehow the database returns the oldest entry only.
return db.collection("tags").find({$query:{id :inp}}).sort({$natural:
-1}).limit(1).next(function(err,result){
console.log(result);
if(err) throw err;
console.log("sending 1 record");
return res.jsonp(result);
via SmridhMalhotra
No comments:
Post a Comment