File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " hawk.api" ,
3- "version" : " 1.2.12 " ,
3+ "version" : " 1.2.13 " ,
44 "main" : " index.ts" ,
55 "license" : " BUSL-1.1" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ const EVENTS_GROUP_HASH_INDEX_NAME = 'groupHashUnique';
1414const REPETITIONS_GROUP_HASH_INDEX_NAME = 'groupHash_hashed' ;
1515const REPETITIONS_USER_ID_INDEX_NAME = 'userId' ;
1616const EVENTS_TIMESTAMP_INDEX_NAME = 'timestamp' ;
17+ const GROUPING_TIMESTAMP_INDEX_NAME = 'groupingTimestamp' ;
18+ const GROUPING_TIMESTAMP_AND_GROUP_HASH_INDEX_NAME = 'groupingTimestampAndGroupHash' ;
1719const MAX_SEARCH_QUERY_LENGTH = 50 ;
1820
1921/**
@@ -101,7 +103,20 @@ module.exports = {
101103
102104 const projectRepetitionsEventsCollection = await mongo . databases . events . createCollection ( 'repetitions:' + project . _id ) ;
103105
104- await mongo . databases . events . createCollection ( 'dailyEvents:' + project . _id ) ;
106+ const projectDailyEventsCollection = await mongo . databases . events . createCollection ( 'dailyEvents:' + project . _id ) ;
107+
108+ await projectDailyEventsCollection . createIndex ( {
109+ groupingTimestamp : 1 ,
110+ } , {
111+ name : GROUPING_TIMESTAMP_INDEX_NAME ,
112+ } ) ;
113+
114+ await projectDailyEventsCollection . createIndex ( {
115+ groupingTimestamp : 1 ,
116+ groupHash : 1 ,
117+ } , {
118+ name : GROUPING_TIMESTAMP_AND_GROUP_HASH_INDEX_NAME ,
119+ } ) ;
105120
106121 await projectEventsCollection . createIndex ( {
107122 groupHash : 1 ,
You can’t perform that action at this time.
0 commit comments