Add indices to DB
This commit is contained in:
1 parent
04e73f43d3
commit
204e0bbf40
2 files changed
+7
-3
No files matched your search
@@ -19,6 +19,7 @@ const CheckSchema = mongoose.Schema(
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "Monitor",
|
||||
immutable: true,
|
||||
index: true,
|
||||
},
|
||||
/**
|
||||
* Status of the check (true for up, false for down).
|
||||
@@ -27,6 +28,7 @@ const CheckSchema = mongoose.Schema(
|
||||
*/
|
||||
status: {
|
||||
type: Boolean,
|
||||
index: true,
|
||||
},
|
||||
/**
|
||||
* Response time of the check in milliseconds.
|
||||
@@ -43,6 +45,7 @@ const CheckSchema = mongoose.Schema(
|
||||
*/
|
||||
statusCode: {
|
||||
type: Number,
|
||||
index: true,
|
||||
},
|
||||
/**
|
||||
* Message or description of the check result.
|
||||
@@ -69,4 +72,6 @@ const CheckSchema = mongoose.Schema(
|
||||
}
|
||||
);
|
||||
|
||||
CheckSchema.index({ createdAt: 1 });
|
||||
|
||||
module.exports = mongoose.model("Check", CheckSchema);
|
||||
Reference in new issue
Block a user