File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,20 @@ class DatabaseSeedingService {
118118 .collection ('sources' )
119119 .createIndex (keys: {'name' : 'text' }, name: 'sources_text_index' );
120120
121+ // Indexes for country aggregation queries
122+ await _db
123+ .collection ('headlines' )
124+ .createIndex (
125+ keys: {'status' : 1 , 'eventCountry.id' : 1 },
126+ name: 'status_eventCountry_index' ,
127+ );
128+ await _db
129+ .collection ('sources' )
130+ .createIndex (
131+ keys: {'status' : 1 , 'headquarters.id' : 1 },
132+ name: 'status_headquarters_index' ,
133+ );
134+
121135 // --- TTL and Unique Indexes via runCommand ---
122136 // The following indexes are created using the generic `runCommand` because
123137 // they require specific options not exposed by the simpler `createIndex`
You can’t perform that action at this time.
0 commit comments