I'm using mongoose 5.11.4 and trying to find documents. On the official docs they say

```
MyModel.find({ name: /john/i })

```

I wanna know how to use variables for "name" & "john" and get the exact thing done. this is an API that I'm working on. filter (name) and the value (john) gonna decide by the frontend user. We should search for a given field using the value. Any suggestions?

```
let filter = req.params.filter
let value = req.params.value

MyModel.find({ filter : /value/i }) 

```

doesn't work