I need help with this query. I am querying 8000 documents in AppVisitorwith 4 collections populated.But it is not returning any result. Means it get stuck and after some time nodejs server return 404 error for route in which this query is executed.
let Keys = yield AppVisitor.find(condition).sort({ createdAt: -1 })
.populate({ path: 'userDeatils' })
.populate({ path: 'details' })
.populate({
path: 'skills',
match: {
$and: [{ value: { $ne: '' } }, { value: { $ne: null } }, { value: { $not: /({R[\d]+})/g } }]
}
})
.populate({ path: 'courses' });