[Server] Fix query performance
This commit is contained in:
parent
18ec136e1a
commit
b82eda5046
6 changed files with 11 additions and 11 deletions
|
|
@ -39,11 +39,11 @@ module.exports = (params, me) =>
|
|||
|
||||
// Construct query
|
||||
const sort = {
|
||||
created_at: -1
|
||||
_id: -1
|
||||
};
|
||||
const query = {};
|
||||
if (since !== null) {
|
||||
sort.created_at = 1;
|
||||
sort._id = 1;
|
||||
query._id = {
|
||||
$gt: new mongo.ObjectID(since)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue