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

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

      • <bdo id='sQQeK'></bdo><ul id='sQQeK'></ul>
      <tfoot id='sQQeK'></tfoot>

      1. 在 dynamodb 中使用 batchWriteItem

        时间:2023-09-03

        • <small id='nuZgy'></small><noframes id='nuZgy'>

          <tfoot id='nuZgy'></tfoot>
                <tbody id='nuZgy'></tbody>
              • <legend id='nuZgy'><style id='nuZgy'><dir id='nuZgy'><q id='nuZgy'></q></dir></style></legend>

                  <bdo id='nuZgy'></bdo><ul id='nuZgy'></ul>
                  <i id='nuZgy'><tr id='nuZgy'><dt id='nuZgy'><q id='nuZgy'><span id='nuZgy'><b id='nuZgy'><form id='nuZgy'><ins id='nuZgy'></ins><ul id='nuZgy'></ul><sub id='nuZgy'></sub></form><legend id='nuZgy'></legend><bdo id='nuZgy'><pre id='nuZgy'><center id='nuZgy'></center></pre></bdo></b><th id='nuZgy'></th></span></q></dt></tr></i><div id='nuZgy'><tfoot id='nuZgy'></tfoot><dl id='nuZgy'><fieldset id='nuZgy'></fieldset></dl></div>
                  本文介绍了在 dynamodb 中使用 batchWriteItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的 dynamo db 中有两个表,一个是候选表,另一个是用户表,我想在 dynamo db 中使用 batchWriteItem 以便在表中添加数据.

                  I have two tables in my dynamo db one is candidate table and the other one is user table I want to use batchWriteItem in dynamo db in order to add the data in the table.

                  我格式化的查询如下

                  var user = {
                          userid: usrid,
                          role: 'candidate',
                          password: vucrypt.encryptpass(pass)
                        };
                  
                        var canduser = {
                          fname: req.body.fname,
                          lname: req.body.lname,
                          location: req.body.location,
                          phone: req.body.phone,
                          ccode: req.body.ccode,
                          grad: req.body.grad,
                          pgrad: req.body.pgrad,
                          ograd: req.body.ograd,
                          experience: exp,
                          linkedin: req.body.linkedin,
                          terms: tandc
                        };
                        canduser = vutools.fixcanduser(canduser);
                        canduser.userid = usrid;
                  
                        var writes = {
                          'users': [{put: user}],
                          'candidate': [{put: canduser}],
                        };
                  

                  但是如果我使用
                  dynamodb.batchWriteItem(writes, function(err, regdata) {}

                  它以错误告终.如何编写正确的查询?我得到的错误是这样的.

                  Its ending up as error. How can I write the right query? The error I am getting is this.

                  MultipleValidationErrors: There were 3 validation errors:
                  * MissingRequiredParameter: Missing required key 'RequestItems' in params
                  * UnexpectedParameter: Unexpected key 'users' found in params
                  * UnexpectedParameter: Unexpected key 'candidate' found in params
                  

                  推荐答案

                  这是正确的答案有一些类型问题.

                  This is the right answer there are some type problems.

                    var createuser = {
                      "RequestItems": {
                        "users": [{
                             "PutRequest": {
                                 Item: {
                                      "userid": {
                                          "S": usrid +""
                                      },
                                      "password": {
                                          "S": vucrypt.encryptpass(pass) +""
                                      },
                                      "role": {
                                        "S": 'candidate' +""
                                      }
                                  }
                               }
                          }],
                        "candidate": [{
                             "PutRequest": {
                               Item: {
                                    "ccode": {
                                        "S": req.body.ccode +""
                                    },
                                    "fname": {
                                        "S": req.body.fname +""
                                    },
                                    "lname": {
                                        "S": req.body.lname +""
                                    },
                                    "pgrad": {
                                        "S": req.body.pgrad +""
                                    },
                                    "videoresumeurl": {
                                        "S": "-"
                                    },
                                    "phone": {
                                        "S": req.body.phone +""
                                    },
                                    "terms": {
                                        "S": tandc +""
                                    },
                                    "location": {
                                        "S": req.body.location +""
                                    },
                                    "experience": {
                                        "N": req.body.experience +""
                                    },
                                    "userid": {
                                        "S": usrid +""
                                    },
                                    "grad": {
                                        "S": req.body.grad +""
                                    }
                                 }
                               }
                          }]
                      }
                    }
                  

                  这篇关于在 dynamodb 中使用 batchWriteItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Node JS 递归获取 DynamoDB 查询中的所有项目 下一篇:dynamodb.put().promise() 不返回 put 对象

                  相关文章

                  最新文章

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

                  <tfoot id='sRP0s'></tfoot>

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

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