update queries to return consistent values
This commit is contained in:
1 parent
abd0006fb1
commit
22b20409fc
3 files changed
+17
-10
No files matched your search
@@ -123,8 +123,12 @@ const getChecksByMonitor = async (req) => {
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
checksCount: { $arrayElemAt: ["$summary.checksCount", 0] },
|
||||
checks: "$checks",
|
||||
checksCount: {
|
||||
$ifNull: [{ $arrayElemAt: ["$summary.checksCount", 0] }, 0],
|
||||
},
|
||||
checks: {
|
||||
$ifNull: ["$checks", []],
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user