Answers for "mongoose search in multiple fields"

1

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} ] })
Posted by: Guest on October-09-2020

Code answers related to "mongoose search in multiple fields"

Code answers related to "Javascript"

Browse Popular Code Answers by Language