Skip to content

Commit 904966a

Browse files
committed
feat(repetition): added index for timestamp of repetition
1 parent 3b12eb6 commit 904966a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/resolvers/project.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const ProjectModel = require('../models/project').default;
1212
const EVENTS_GROUP_HASH_INDEX_NAME = 'groupHashUnique';
1313
const REPETITIONS_GROUP_HASH_INDEX_NAME = 'groupHash_hashed';
1414
const REPETITIONS_USER_ID_INDEX_NAME = 'userId';
15+
const EVENTS_TIMESTAMP_INDEX_NAME = 'timestamp';
1516
const MAX_SEARCH_QUERY_LENGTH = 50;
1617

1718
/**
@@ -123,6 +124,13 @@ module.exports = {
123124
sparse: true,
124125
});
125126

127+
await projectEventsCollection.createIndex({
128+
'timestamp': 1,
129+
}, {
130+
name: EVENTS_TIMESTAMP_INDEX_NAME,
131+
sparse: true,
132+
});
133+
126134
telegram.sendMessage(`🤯 Project ${name} was created`);
127135

128136
return project;

0 commit comments

Comments
 (0)