Sort without old data

This commit is contained in:
Jonathan Cremin 2014-12-16 17:48:50 +00:00
parent fb1c1ef2ae
commit 8ad7f0f6b0

2
app.js
View file

@ -60,7 +60,7 @@ app.get('*', function(req,res,next) {
});
app.get('/', function(req, res) {
req.db.matches.find().sort({created_at:-1}).limit(6).toArray().then(function(docs){
req.db.matches.find().sort({'$natural':-1}).limit(6).toArray().then(function(docs){
res.render('index', { page: "home", recent: docs, error: req.flash('search-error') });
});
});