This question already has an answer here:
I am trying to implement MySQL like query in mongo db with PHP but I don't know how to do that.
select * from stud where name like "%abc%"
php code:
$regex = new \MongoDB\BSON\Regex("^(.*?(\abc\b)[^$]*)i$");
$result = $db->stud->find(array('name' => $regex));
I also Tried this
$result = $db->stud->find(( { name : { $regex: '*.abc.*'} } ));
</div>