Skip to content

Commit 86ec028

Browse files
authored
Update query to find a project's most recent sync failures (#3194)
1 parent bab737c commit 86ec028

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mongodb/Projects/SyncFailureCause.mongodb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use("xforge");
22

33
const shortName = "";
4+
const since = new Date(Date.now() - 1000 * 60 * 60 * 24 * 7); // 7 days ago
45

56
const project = db.sf_projects.findOne({
67
shortName: shortName
@@ -16,7 +17,8 @@ const metrics = db.sync_metrics.aggregate([
1617
{
1718
$match: {
1819
projectRef: id,
19-
errorDetails: { $exists: true }
20+
errorDetails: { $exists: true },
21+
dateStarted: { $gte: since }
2022
}
2123
},
2224
{

0 commit comments

Comments
 (0)