Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make like query in MongoDb

    • 0
    • 2
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 472
    Comment on it

    Below is the way you can make like query in MongoDb :

    It can basically be achieved by using MongoRegex

    $where=array();
            if($param['searchfor']!=""){
                $regexObj = new MongoRegex("/".$param['searchfor']."/ig");
                $where['searchValue']=$regexObj;
            }
    
    $result = $collection->find($where,array("_id"))->count(); 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: