Add distributed uptime model
This commit is contained in:
1 parent
70ba745e07
commit
1303497947
1 file changed
+15
@@ -0,0 +1,15 @@
|
|||||||
|
import mongoose from "mongoose";
|
||||||
|
import { BaseCheckSchema } from "./Check.js";
|
||||||
|
|
||||||
|
const DistributedUptimeCheckSchema = mongoose.Schema(
|
||||||
|
{
|
||||||
|
...BaseCheckSchema.obj,
|
||||||
|
},
|
||||||
|
{ timestamps: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
DistributedUptimeCheckSchema.index({ createdAt: 1 });
|
||||||
|
DistributedUptimeCheckSchema.index({ monitorId: 1, createdAt: 1 });
|
||||||
|
DistributedUptimeCheckSchema.index({ monitorId: 1, createdAt: -1 });
|
||||||
|
|
||||||
|
export default mongoose.model("DistributedUptimeCheck", DistributedUptimeCheckSchema);
|
||||||
Reference in new issue
Block a user