I have a schema like this:
{
_id: ObjectId("5a7acda13b808dbed05d6b7e"),
name: "An Apple eat by Man"
}
For that I wrote the query i.e :
db.Collection.find({post: { $regex: req.body.query, $options: "i" }})
.then(data => {
console.log(data)
})
.catch(error => {
console.log(error)
})
So for that Query if I write "An Apple" it return the data, but if I write "eat man" then it will not return data.
Any guess where I am doing wrong, Any help or suggestion is really appreciated