Skip to content
Snippets Groups Projects
Commit 57816c11 authored by Inès Yeterian's avatar Inès Yeterian
Browse files

try to find last toucan in a fast way

parent 6ea01ca6
No related branches found
No related tags found
1 merge request!6Last toucan
......@@ -149,11 +149,12 @@ router.get('/pdf/:year/:title', (req, res) => {
});
});
router.get('/pdf/lastToucan', (res) => {
router.get('/pdf/lastToucan', (req, res) => {
Toucan.find()
.exec(function(err, toucans){
if(err) {res.send(err);}
else{
else
{
var max = new Date(toucans[0].date);
var idMax = toucans[0]._id;
const nbToucans = toucans.length;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment