summaryrefslogtreecommitdiff
path: root/src/api/endpoints/aggregation
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/endpoints/aggregation')
-rw-r--r--src/api/endpoints/aggregation/posts/reactions.ts11
-rw-r--r--src/api/endpoints/aggregation/users.ts13
2 files changed, 15 insertions, 9 deletions
diff --git a/src/api/endpoints/aggregation/posts/reactions.ts b/src/api/endpoints/aggregation/posts/reactions.ts
index 2cd4588ae1..790b523be9 100644
--- a/src/api/endpoints/aggregation/posts/reactions.ts
+++ b/src/api/endpoints/aggregation/posts/reactions.ts
@@ -35,10 +35,13 @@ module.exports = (params) => new Promise(async (res, rej) => {
{ deleted_at: { $gt: startTime } }
]
}, {
- _id: false,
- post_id: false
- }, {
- sort: { created_at: -1 }
+ sort: {
+ _id: -1
+ },
+ fields: {
+ _id: false,
+ post_id: false
+ }
});
const graph = [];
diff --git a/src/api/endpoints/aggregation/users.ts b/src/api/endpoints/aggregation/users.ts
index 9eb2d035ec..e38ce92ff9 100644
--- a/src/api/endpoints/aggregation/users.ts
+++ b/src/api/endpoints/aggregation/users.ts
@@ -17,11 +17,14 @@ module.exports = params => new Promise(async (res, rej) => {
const users = await User
.find({}, {
- _id: false,
- created_at: true,
- deleted_at: true
- }, {
- sort: { created_at: -1 }
+ sort: {
+ _id: -1
+ },
+ fields: {
+ _id: false,
+ created_at: true,
+ deleted_at: true
+ }
});
const graph = [];