You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//this is in the app.js file
app.get('/api/user/last', (req, res)=>{
User.getLastEntry((err, user)=>{
if(err) throw err;
res.json(user);
});
});
//this is in the users.js file (mongoose model)
module.exports.getLastEntry = (callback)=>{
User.find(callback).sort({'_id':-1}).limit(1);
}
I don't know how to use the params to get the last entry so using this instead.
I don't know where else to ask you about it. Thank you for the awesome lessons.
The text was updated successfully, but these errors were encountered:
I don't know how to use the params to get the last entry so using this instead.
I don't know where else to ask you about it. Thank you for the awesome lessons.
The text was updated successfully, but these errors were encountered: