title: Couchbase on Nodejs - how the add () method works?
body: <p>It's a basic question but i'm learning couchbase now and in my fail i'm trying to insert Data into my couchbase instance with the add() method. But something in my code doesnt work well and i dont know why.</p>
  
  <pre><code>var http = require("http");
  
  var driver = require('couchbase');
  var cb = new driver.Cluster("127.0.0.1:8091", null, null, "default");
  var server = http.createServer(insertData);
  
  
  
  console.log ("BA4KAAAAA!!");
  
  function insertData() {
      var emps = [{
          "type": "employee",
          "id": 100,
          "name": "Anton",
          "dept": "Sales",
          "salary": 5000
      }, {
          "type": "employee",
          "id": 200,
          "name": "Ivan",
          "dept": "IT",
          "salary": 3000
      }, {
          "type": "employee",
          "id": 300,
          "name": "Petko",
          "dept": "Manager",
          "salary": 10000
  
  
  }]
      for (index = 0; index&lt; emps.lenght; index++) {
          cb.add(JSON.stringify(emps[index].id), JSON.stringify(emps[index]), 0, undefined, function(data, err, key, cas ) {
              if (err&amp;&amp;err != 12) {
                  console.log("FAIL!" + err);
              }
          });
      }
  }
  
  server.listen(8080, insertData());
  </code></pre>
  
  <p>I run the server and the console says it works but nothing changes into my CB Admin tool.</p>