I'm doing a project with node and using the mongoose
app.get('/', (req, res) => {
Habbo.find({}).then((habbo) => {
return res.json(habbo);
}).catch((erro) => {
return res.status(400).json({
error: true,
message: "Nenhum artigo encontrado!"
})
})
});
I'm just managing to make it show all the records in the database, I need it to show me only the last record
I've tried several ways but I'm not getting it, can someone help me?