title: Using batchWriteItem in dynamodb
body: <p>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.</p>
  
  <p>The query which I have formatted is as follows</p>
  
  <pre><code>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}],
        };
  </code></pre>
  
  <p>But if i use<br>
   <code>dynamodb.batchWriteItem(writes, function(err, regdata) {
   }</code></p>
  
  <p>Its ending up as error. 
  How can I write the right query? The error I am getting is this.</p>
  
  <pre><code>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
  </code></pre>