From 91115ca22eed257d5a0019cba0b204e61873e078 Mon Sep 17 00:00:00 2001 From: cheetah Date: Tue, 31 Mar 2020 12:19:12 +0200 Subject: [PATCH] fixed sorting --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d3dab55..7a28350 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,7 @@ app.use('/', serveStatic(require('path').join(__dirname, 'app_html'))) const { mongoose, Models } = require('./database') const processOneAccount = async () => { - let theAccount = await Models.MCAccount.find({ validState: { $gte: 0 } }).sort({ validState: 1, lastUpdate: -1 }).limit(1) + let theAccount = await Models.MCAccount.find({ validState: { $gte: 0 } }).sort({ validState: 1, lastUpdate: 1 }).limit(1) theAccount = theAccount[0] console.log(theAccount) try {