How to make “LIKE” query work in MongoDB?

后端 未结 7 1701
梦谈多话
梦谈多话 2021-01-03 00:07

I have a list of street names and I want to select all that start with \"Al\". In my MySQL I would do something like

SELECT * FROM streets WHERE \"street_nam         


        
相关标签:
7条回答
  • 2021-01-03 01:03
    <?php
    $mongoObj = new MongoClient();
    $where = array("name" => new MongoRegex("^/AI/i"));
    $mongoObj->dbName->collectionName->find($where);
    ?>
    

    View for more details

    0 讨论(0)
提交回复
热议问题