0

i have tried to following query with php but doesnot return record

PHP

$keyword = "/.*".$_POST['keyword'].".*/";   
$query = array("evnt_name" => $keyword);
if($cursor = $db->mycollname->find($query)){
   return $cursor;
}

i have refferd to How to query MongoDB with "like"?

Community
  • 1
  • 1
Balakumar B
  • 770
  • 5
  • 17
  • 41
  • Please check url you provided here for reference carefully and make sure that your $keyword value is correct as you want to pass in mongo db query also you pass array over here and as you check in reference link over there json structure data pass – jilesh Mar 07 '17 at 10:46
  • you can try with regex. – Basant Rules Mar 29 '17 at 05:36

0 Answers0