title: How to update data in cloudant using nodejs cloudant module?
body: <p>Below mentioned sample json documents.It contains two fields.</p>
  
  <pre><code>{
    "_id": "daef4a0e39c0c7a00feb721f6c4ce8b9",
  
    "_rev": "2-8c7ef28df59ecbdaa23b536e58691416",
  
    "name": "sukil",
  
    "skills": "java"
  }
  
  
  In server.js
  
  var express = require('express');
  
  var app = express();
  
  var cloudant = require('cloudant');
  
  cloudant({account:"test", password:"test"}, function(err, cloudant) {
  
  var alice = cloudant.use('opti-update')
  alice.atomic("_design/sample", "inplace", "daef4a0e39c0c7a00feb721f6c4ce8b9", {field: "name", value: "bar"}, function (error, response) {
   console.log(error+""+response);
  })
  })
  </code></pre>
  
  <p>Here _design/sample is a design document name and inplace is update function name then next is document id.It returns error is document update conflict and response is undefined.</p>
  
  <pre><code>In design document mentioned below
  
  {
    "_id": "_design/sample",
  
    "_rev": "9-94393ee4665bdfd6fb283e3419a53f24",
  
    "updates": {
  
      "inplace": "function(doc,req){var field = req.body.field;var value = req.body.value;doc[field] = value;return [doc,''];}"
  
    }
  }
  
  
  I want to update the data in cloudant using node cloudant module. I want to update the name field in json document.Above method i tried but it shows document update conflict error.How to resolve this?
  </code></pre>