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

    <legend id='pVzzJ'><style id='pVzzJ'><dir id='pVzzJ'><q id='pVzzJ'></q></dir></style></legend><tfoot id='pVzzJ'></tfoot>

        <bdo id='pVzzJ'></bdo><ul id='pVzzJ'></ul>
    1. Sequelize update 不再起作用:“在传递给 update 的选项参数中缺少 where 属性"

      Sequelize update does not work anymore: quot;Missing where attribute in the options parameter passed to updatequot;(Sequelize update 不再起作用:“在传递给 update 的选项参数中缺少 where 属性)
    2. <legend id='TK0b5'><style id='TK0b5'><dir id='TK0b5'><q id='TK0b5'></q></dir></style></legend>

          <tbody id='TK0b5'></tbody>

          <tfoot id='TK0b5'></tfoot>

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

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

              • 本文介绍了Sequelize update 不再起作用:“在传递给 update 的选项参数中缺少 where 属性"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                官方 API 文档 建议像这样使用 Model.update:

                var gid = ...;
                var uid = ...;
                
                var values = { gid: gid };
                var where = { uid: uid };
                myModel.update(values, where)
                .then(function() {
                    // update callback
                });
                

                但这给了我:传递给更新的选项参数中缺少 where 属性".文档还提到不推荐使用这种用法.看到这个错误让我想,他们已经改变了它.我做错了什么?

                But this gives me: "Missing where attribute in the options parameter passed to update". The docs also mention that this usage is deprecated. Seeing this error makes me think, they already changed it. What am I doing wrong?

                推荐答案

                显然,文档还没有更新.但是 where 行">Model.update API 文档 建议在您的选择前加上 where,如下所示:

                Apparently, the docs have not been updated yet. But the table's where row of the Model.update API docs suggests prefixing your selection with where, like so:

                var gid = ...;
                var uid = ...;
                
                var values = { gid: gid };
                var selector = { 
                  where: { uid: uid }
                };
                myModel.update(values, selector)
                .then(function() {
                    // update callback
                });
                

                而且它有效!

                更新:

                文档已更新(文档也已移动).查看 docs.sequelize.com 上的 Model.update.请注意,options.where 不是可选的(它不在括号 [] 中).

                The docs have since been updated (and the docs have also been moved). Check out Model.update on docs.sequelize.com. Note that options.where is not optional (it is not in brackets []).

                这篇关于Sequelize update 不再起作用:“在传递给 update 的选项参数中缺少 where 属性"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)

                    <bdo id='1rLM7'></bdo><ul id='1rLM7'></ul>
                  • <small id='1rLM7'></small><noframes id='1rLM7'>

                    <tfoot id='1rLM7'></tfoot>

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