title: Elasticsearch: how to store all json objects dynamically
body: <p>I'm trying to store all Json objects through elasticsearch.</p>
  
  <pre><code>client.create({
                  index: 'index',
                  type: 'type',
                  id:"1"
                  body:result[0]
                  },function (error,response)
                     {
                       if (error) 
                       {
                          console.log('elasticsearch cluster is down!');
                        } 
                        else 
                        {
                          console.log('All is well');
                        }
              });
  </code></pre>
  
  <p>In this  <code>result[0]</code> I'm getting my first value of a Json object but I need to store all Json objects dynamically.</p>
  
  <p>The output which i'm getting is:</p>
  
  <pre><code>  -&gt; POST http://localhost:9200/index/type/1?op_type=create
    {
      "Name": "Martin",
      "Age": "43",
      "Address": "trichy"
    }
    &lt;- 201
    {
      "_index": "index",
      "_type": "type",
      "_id": "1",
      "_version": 4,
      "created": true
    }
  </code></pre>
  
  <p>But I need an output like this:</p>
  
  <pre><code> -&gt; POST http://localhost:9200/index/type/1?op_type=create
        {
          "Name": "Martin",
          "Age": "43",
          "Address": "trichy"
        },
        {
          "Name": "vel",
          "Age": "23",
          "Address": "chennai"
        },
        {
          "Name": "ajay",
          "Age": "23",
          "Address": "chennai"
        }
        &lt;- 201
        {
          "_index": "index",
          "_type": "type",
          "_id": "1",
          "_version": 4,
          "created": true
        }
  </code></pre>