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
let test = `what your regex should search`; collection.find({ fieldName: {$regex: test} }).then(result => red.send(result));
// tested on mongoose but should work on mongodb too