Merge pull request #1481 from bluewave-labs/fix/be/db-indices

fix: be/db indices
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-12-31 17:38:29 -08:00
commit 350e560079
4 files changed
+21 -2

No files matched your search

+3
View File
@@ -67,5 +67,8 @@ const BaseCheckSchema = mongoose.Schema({
*/
const CheckSchema = mongoose.Schema({ ...BaseCheckSchema.obj }, { timestamps: true });
CheckSchema.index({ createdAt: 1 });
CheckSchema.index({ monitorId: 1, createdAt: 1 });
CheckSchema.index({ monitorId: 1, createdAt: -1 });
export default mongoose.model("Check", CheckSchema);
export { BaseCheckSchema };
+2
View File
@@ -64,5 +64,7 @@ const HardwareCheckSchema = mongoose.Schema(
);
HardwareCheckSchema.index({ createdAt: 1 });
HardwareCheckSchema.index({ monitorId: 1, createdAt: 1 });
HardwareCheckSchema.index({ monitorId: 1, createdAt: -1 });
export default mongoose.model("HardwareCheck", HardwareCheckSchema);