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

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

      1. <tfoot id='i1IGa'></tfoot>

        <small id='i1IGa'></small><noframes id='i1IGa'>

        Mongoose.js:通过用户名 LIKE 值查找用户

        时间:2023-10-02
          1. <small id='HSiEL'></small><noframes id='HSiEL'>

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

                <bdo id='HSiEL'></bdo><ul id='HSiEL'></ul>
                  <tbody id='HSiEL'></tbody>
                <tfoot id='HSiEL'></tfoot>

                  本文介绍了Mongoose.js:通过用户名 LIKE 值查找用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我喜欢通过查找名为 value 的用户在 mongoDb 中查找用户.问题:

                  I like to to go find a user in mongoDb by looking for a user called value. The problem with:

                  username: 'peter'
                  

                  如果用户名是Peter"或PeTER".. 或类似的东西,我找不到它.

                  is that i dont find it if the username is "Peter", or "PeTER".. or something like that.

                  所以我想像 sql 那样做

                  So i want to do like sql

                  SELECT * FROM users WHERE username LIKE 'peter'
                  

                  希望你们得到我的要求?

                  Hope you guys get what im askin for?

                  简短:mongoose.js/mongodb 中的字段 LIKE 值"

                  推荐答案

                  对于那些在这里寻找解决方案的人来说:

                  For those that were looking for a solution here it is:

                  var name = 'Peter';
                  model.findOne({name: new RegExp('^'+name+'$', "i")}, function(err, doc) {
                    //Do your action here..
                  });
                  

                  这篇关于Mongoose.js:通过用户名 LIKE 值查找用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:你如何设置“url"?创建新的响应()时? 下一篇:有没有办法检测在 javascript 中的页面搜索中的查找

                  相关文章

                    <small id='kOY6O'></small><noframes id='kOY6O'>

                    <legend id='kOY6O'><style id='kOY6O'><dir id='kOY6O'><q id='kOY6O'></q></dir></style></legend>

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