Yuki Takei 1 год назад
Родитель
Сommit
00dbefbb42
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      apps/app/src/server/models/page.ts

+ 3 - 0
apps/app/src/server/models/page.ts

@@ -153,6 +153,9 @@ const schema = new Schema<PageDocument, PageModel>({
   toJSON: { getters: true },
   toObject: { getters: true },
 });
+// indexes
+schema.index({ createdAt: 1 });
+schema.index({ updatedAt: 1 });
 // apply plugins
 schema.plugin(mongoosePaginate);
 schema.plugin(uniqueValidator);