format
This commit is contained in:
1 parent
e6c268f14e
commit
995ae5252d
1 file changed
+2
-10
@@ -92,11 +92,7 @@ class MongoMonitorsRepository implements IMonitorsRepository {
|
|||||||
$lookup: {
|
$lookup: {
|
||||||
from: "checks",
|
from: "checks",
|
||||||
let: { monitorId: "$_id" },
|
let: { monitorId: "$_id" },
|
||||||
pipeline: [
|
pipeline: [{ $match: { $expr: { $eq: ["$metadata.monitorId", "$$monitorId"] } } }, { $sort: { createdAt: -1 } }, { $limit: checksCount }],
|
||||||
{ $match: { $expr: { $eq: ["$metadata.monitorId", "$$monitorId"] } } },
|
|
||||||
{ $sort: { createdAt: -1 } },
|
|
||||||
{ $limit: checksCount },
|
|
||||||
],
|
|
||||||
as: "checks",
|
as: "checks",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -126,11 +122,7 @@ class MongoMonitorsRepository implements IMonitorsRepository {
|
|||||||
$or: [
|
$or: [
|
||||||
"$$value",
|
"$$value",
|
||||||
{
|
{
|
||||||
$and: [
|
$and: [{ $eq: ["$$this.active", true] }, { $lte: ["$$this.start", "$$NOW"] }, { $gte: ["$$this.end", "$$NOW"] }],
|
||||||
{ $eq: ["$$this.active", true] },
|
|
||||||
{ $lte: ["$$this.start", "$$NOW"] },
|
|
||||||
{ $gte: ["$$this.end", "$$NOW"] },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user