I would like to make query MongoDB for documents based on a regex expression that I contruct. For e.g I have constructed a simple regex as follows that is a combination of a
Use the following code to use dynamic value in regex with or operations
{$match: { $or: [{ 'title': { $regex: request.query.val, $options: 'i'} }, { 'skills_required': { $regex: request.query.val, $options: 'i'} }] }},