remove mongo middleware
This commit is contained in:
1 parent
74a7f0a701
commit
68559741ba
19 files changed
+247
-141
No files matched your search
@@ -54,6 +54,9 @@ export interface UptimeChecksResult {
|
||||
}
|
||||
|
||||
export interface IChecksRepository {
|
||||
// create
|
||||
// single fetch
|
||||
// collection fetch
|
||||
findLatestChecksByMonitorIds(monitorIds: string[], options?: { limitPerMonitor?: number }): Promise<LatestChecksMap>;
|
||||
findDateRangeChecksByMonitor(
|
||||
monitorId: string,
|
||||
@@ -62,4 +65,7 @@ export interface IChecksRepository {
|
||||
dateString: string,
|
||||
options?: { type?: MonitorType }
|
||||
): Promise<UptimeChecksResult | HardwareChecksResult | PageSpeedChecksResult>;
|
||||
// update
|
||||
//delete
|
||||
deleteByMonitorId(monitorId: string): Promise<number>;
|
||||
}
|
||||
@@ -385,6 +385,11 @@ class MongoChecksRepository implements IChecksRepository {
|
||||
checks: checks.map((doc) => this.toEntity(doc)),
|
||||
};
|
||||
};
|
||||
|
||||
deleteByMonitorId = async (monitorId: string): Promise<number> => {
|
||||
const result = await CheckModel.deleteMany({ "metadata.monitorId": monitorId });
|
||||
return result.deletedCount;
|
||||
};
|
||||
}
|
||||
|
||||
export default MongoChecksRepository;
|
||||
Reference in new issue
Block a user