// query = req.body
let searchTerm = '';
if (query?.searchTerm) {
searchTerm = query?.searchTerm;
}
const result = await Student.find({
$or: ['email', 'name.firstName', 'presentAddress'].map((field) => ({
[field]: { $regex: searchTerm, $options: 'i' },
})),
})
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)