• <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 值查找用户

        Mongoose.js: Find user by username LIKE value(Mongoose.js:通过用户名 LIKE 值查找用户)
          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 值查找用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))

                        <tbody id='kOY6O'></tbody>

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

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

                    • <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>
                    • <tfoot id='kOY6O'></tfoot>
                      • <bdo id='kOY6O'></bdo><ul id='kOY6O'></ul>