Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.2.15",
"version": "1.2.16",
"main": "index.ts",
"license": "BUSL-1.1",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions src/resolvers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const REPETITIONS_USER_ID_INDEX_NAME = 'userId';
const EVENTS_TIMESTAMP_INDEX_NAME = 'timestamp';
const GROUPING_TIMESTAMP_INDEX_NAME = 'groupingTimestamp';
const GROUPING_TIMESTAMP_AND_GROUP_HASH_INDEX_NAME = 'groupingTimestampAndGroupHash';
const GROUPING_TIMESTAMP_AND_LAST_REPETITION_TIME_AND_ID_INDEX_NAME = 'groupingTimestampAndLastRepetitionTimeAndId';
const MAX_SEARCH_QUERY_LENGTH = 50;

/**
Expand Down Expand Up @@ -117,6 +118,14 @@ module.exports = {
name: GROUPING_TIMESTAMP_AND_GROUP_HASH_INDEX_NAME,
});

await projectDailyEventsCollection.createIndex({
groupingTimestamp: -1,
lastRepetitionTime: -1,
_id: -1,
}, {
name: GROUPING_TIMESTAMP_AND_LAST_REPETITION_TIME_AND_ID_INDEX_NAME,
});

await projectEventsCollection.createIndex({
groupHash: 1,
},
Expand Down