populate multiple fields in mongoose code example
Example 1: mongoose multiple populate
Story.
find(...).
populate('fans').
populate('author').
exec();
Example 2: mongoose search in multiple fields
let regex = new RegExp(value.searchQuery,'i');
const filterd = await Model.find({ $and: [ { $or: [{title: regex },{description: regex}] }, {category: value.category}, {city:value.city} ] })