when I run the test It passes with “green colors”, but click on the status I get invalid response. my code is:
try {
// TODO Ticket: User Report
// Return the 20 users who have commented the most on MFlix.
const pipeline = [
{
$group:{
_id: '$email',
count: {$sum:1}
}
},{
$sort:{
count: -1
}
},{
$limit:20
}
]
// TODO Ticket: User Report
// Use a more durable Read Concern here to make sure this data is not stale.
const readConcern = comments.readConcern
const aggregateResult = await comments.aggregate(pipeline,
{
readConcern:{level: "majority"},
}
)
return await aggregateResult.toArray()
} catch (e) {
console.error(`Unable to retrieve most active commenters: ${e}`)
return { error: e }
}
}
}
by the way, when I comment out the readConcern part, the test still passes and the “click to begin validation” still does not work.