diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-05-14 13:58:44 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-05-14 13:58:44 +0900 |
| commit | 97c4758de21c3eb0ba36cbeb8d50281ccd485ba2 (patch) | |
| tree | 20ed8f83c3a564fa44e5fb42beb4ebbac339ef4d /src/server/api | |
| parent | Fix bug (diff) | |
| download | sharkey-97c4758de21c3eb0ba36cbeb8d50281ccd485ba2.tar.gz sharkey-97c4758de21c3eb0ba36cbeb8d50281ccd485ba2.tar.bz2 sharkey-97c4758de21c3eb0ba36cbeb8d50281ccd485ba2.zip | |
Use _id instead of createdAt to improve performance
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/notes/trend.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/server/api/endpoints/notes/trend.ts b/src/server/api/endpoints/notes/trend.ts index cb3912dc48..4735bec51e 100644 --- a/src/server/api/endpoints/notes/trend.ts +++ b/src/server/api/endpoints/notes/trend.ts @@ -38,12 +38,8 @@ module.exports = (params, user) => new Promise(async (res, rej) => { if (pollErr) return rej('invalid poll param'); const query = { - createdAt: { - $gte: new Date(Date.now() - ms('1days')) - }, - renoteCount: { - $gt: 0 - }, + _id: { $gte: new Date(Date.now() - ms('1days')) }, + renoteCount: { $gt: 0 }, '_user.host': null } as any; |