Add indices to DB
This commit is contained in:
1 parent
04e73f43d3
commit
204e0bbf40
2 files changed
+7
-3
No files matched your search
@@ -149,13 +149,12 @@ const getTeamChecks = async (req) => {
|
||||
let { sortOrder, limit, dateRange, filter, page, rowsPerPage } = req.query;
|
||||
|
||||
// Get monitorIDs
|
||||
const userMonitors = await Monitor.find({ teamId: teamId });
|
||||
const userMonitors = await Monitor.find({ teamId: teamId }).select("_id");
|
||||
const monitorIds = userMonitors.map((monitor) => monitor._id);
|
||||
|
||||
//Build check query
|
||||
// Default limit to 0 if not provided
|
||||
limit = limit === "undefined" ? 0 : limit;
|
||||
|
||||
limit = limit === undefined ? 0 : limit;
|
||||
// Default sort order is newest -> oldest
|
||||
sortOrder = sortOrder === "asc" ? 1 : -1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user