Explorar el Código

add some indices to increase performance

Sven Czarnian hace 2 años
padre
commit
ad843e4706

+ 1 - 0
src/airport/models/airport.model.ts

@@ -12,6 +12,7 @@ export type AirportDocument = Airport & Document;
 export class Airport {
   @Prop({
     required: true,
+    index: true,
     type: String,
   })
   icao: string;

+ 2 - 0
src/logging/models/logentry.model.ts

@@ -7,12 +7,14 @@ export type LogEntryDocument = LogEntry & Document;
 export class LogEntry {
   @Prop({
     required: true,
+    index: true,
     type: String,
   })
   component: string;
 
   @Prop({
     required: true,
+    index: true,
     enum: ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
     type: String,
   })

+ 2 - 1
src/performance/models/performance.model.ts

@@ -10,8 +10,9 @@ export type PerformanceDocument = Performance & Document;
 @Schema()
 export class Performance {
   @Prop({
-    type: String,
     required: true,
+    index: true,
+    type: String,
   })
   icaoCode: string;