sort on created date
This commit is contained in:
parent
23896f7ee6
commit
0c1bcb728d
2 changed files with 2 additions and 2 deletions
2
app.js
2
app.js
|
@ -60,7 +60,7 @@ app.get('*', function(req,res,next) {
|
|||
});
|
||||
|
||||
app.get('/', function(req, res) {
|
||||
req.db.matches.find().sort({$natural:-1}).limit(6).toArray().then(function(docs){
|
||||
req.db.matches.find().sort({created_at:-1}).limit(6).toArray().then(function(docs){
|
||||
res.render('index', { page: "home", recent: docs, error: req.flash('search-error') });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports.parseUrl = function(url) {
|
|||
};
|
||||
|
||||
module.exports.lookupId = function(id, type, cc) {
|
||||
if (id.match(/^[a-z]{2}/)) {
|
||||
if (String(id).match(/^[a-z]{2}/)) {
|
||||
cc = id.substr(0,2);
|
||||
id = id.substr(2);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue