1. <small id='WF4jm'></small><noframes id='WF4jm'>

      1. <legend id='WF4jm'><style id='WF4jm'><dir id='WF4jm'><q id='WF4jm'></q></dir></style></legend>
        <i id='WF4jm'><tr id='WF4jm'><dt id='WF4jm'><q id='WF4jm'><span id='WF4jm'><b id='WF4jm'><form id='WF4jm'><ins id='WF4jm'></ins><ul id='WF4jm'></ul><sub id='WF4jm'></sub></form><legend id='WF4jm'></legend><bdo id='WF4jm'><pre id='WF4jm'><center id='WF4jm'></center></pre></bdo></b><th id='WF4jm'></th></span></q></dt></tr></i><div id='WF4jm'><tfoot id='WF4jm'></tfoot><dl id='WF4jm'><fieldset id='WF4jm'></fieldset></dl></div>
        <tfoot id='WF4jm'></tfoot>
          <bdo id='WF4jm'></bdo><ul id='WF4jm'></ul>

        Laravel 'like' 查询与 MongoDB 连接

        时间:2023-09-22
        <i id='lj1Zb'><tr id='lj1Zb'><dt id='lj1Zb'><q id='lj1Zb'><span id='lj1Zb'><b id='lj1Zb'><form id='lj1Zb'><ins id='lj1Zb'></ins><ul id='lj1Zb'></ul><sub id='lj1Zb'></sub></form><legend id='lj1Zb'></legend><bdo id='lj1Zb'><pre id='lj1Zb'><center id='lj1Zb'></center></pre></bdo></b><th id='lj1Zb'></th></span></q></dt></tr></i><div id='lj1Zb'><tfoot id='lj1Zb'></tfoot><dl id='lj1Zb'><fieldset id='lj1Zb'></fieldset></dl></div>

            • <bdo id='lj1Zb'></bdo><ul id='lj1Zb'></ul>

              <tfoot id='lj1Zb'></tfoot>

                <tbody id='lj1Zb'></tbody>
              <legend id='lj1Zb'><style id='lj1Zb'><dir id='lj1Zb'><q id='lj1Zb'></q></dir></style></legend>
              • <small id='lj1Zb'></small><noframes id='lj1Zb'>

                1. 本文介绍了Laravel 'like' 查询与 MongoDB 连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 laravel 'like' 查询中遇到问题.我在 Laravel 上有一个 MIS,在 MongoDb 上有数据库.现在我的数据库有一个名为 kw 的表,带有像 cars%20in%20London 这样的 urlencoded 关键字,现在我的查询给出了 cars 的准确结果>cars%20in%20London 但是当我搜索 cars%20in 时,我得到 0 个结果!这就是在查询中使用 laravel 'like' 的方式,但 Mongo 使用/.m./形式,我该如何使其工作.这是我的模型函数

                  I am facing an issue in laravel 'like' query. I have a MIS on laravel with databases on MongoDb. Now my DB has a table named kw with urlencoded keywords like cars%20in%20London, Now my query gives accurate results for cars or cars%20in%20London but when I search cars%20in I get 0 results! This is how laravel 'like' is used in query but Mongo uses /.m./ form, How can I make this working. Here is my Model function

                  public static function selectKeywordIncomplete($keyword) {   
                      $search_volume_incomplete = searchVolume::where('kw','like','%'.$keyword.'%')->orwhere('kw','=',$keyword)->where('status','=',1)->paginate(20);
                      return $search_volume_incomplete; 
                  }
                  

                  推荐答案

                  因为在 mongoDb 中没有like"这样的东西,所以我寻找了 Mongodb regex,但是 mongoDB 的 laravel regexp 很有魅力,这是有效的查询.http://jenssegers.be/projects/laravel-mongodb

                  well as there is no such thing as 'like' in mongoDb, I looked for Mongodb regex, but laravel regexp for mongoDB worked as a charm, here is the query which worked. http://jenssegers.be/projects/laravel-mongodb

                  $search_volume_unprocessed =searchVolume::where('kw','=',$keyword)->orwhere('kw','regexp',"/.*$keyword/i")->where('status','=',1)->分页(20);

                  $search_volume_unprocessed = searchVolume::where('kw','=',$keyword)->orwhere('kw','regexp',"/.*$keyword/i")->where('status','=',1)->paginate(20);

                  这篇关于Laravel 'like' 查询与 MongoDB 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Laravel - 数据透视表上的附加关系 下一篇:雄辩的 laravel WhereIn All

                  相关文章

                  最新文章

                  <legend id='azCB8'><style id='azCB8'><dir id='azCB8'><q id='azCB8'></q></dir></style></legend>
                    <bdo id='azCB8'></bdo><ul id='azCB8'></ul>

                  <i id='azCB8'><tr id='azCB8'><dt id='azCB8'><q id='azCB8'><span id='azCB8'><b id='azCB8'><form id='azCB8'><ins id='azCB8'></ins><ul id='azCB8'></ul><sub id='azCB8'></sub></form><legend id='azCB8'></legend><bdo id='azCB8'><pre id='azCB8'><center id='azCB8'></center></pre></bdo></b><th id='azCB8'></th></span></q></dt></tr></i><div id='azCB8'><tfoot id='azCB8'></tfoot><dl id='azCB8'><fieldset id='azCB8'></fieldset></dl></div>

                  1. <tfoot id='azCB8'></tfoot>
                    1. <small id='azCB8'></small><noframes id='azCB8'>