How to add a new field to ElasticSearch?
<p>I am trying to add a new field to elasticsearch - called "dateAdded" which will be used to sort the data as well. Not sure how to go about it with nodejs.</p>

<p>I am looking here?</p>

<p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html</a> </p>

<p>I only see an example for using curl, how can I do it using nodejs with this module - <a href="https://github.com/elastic/elasticsearch-js" rel="nofollow noreferrer">https://github.com/elastic/elasticsearch-js</a></p>

<p>This is how I originally indexed it:</p>

<pre><code>esclient.index({  
                              index: 'projects',
                              type: 'project',
                              id: projectIdStr,
                              body: {
                                "title": proj.title,
                                "company": proj.company,
                                "tags": proj.tagsArray,
                                "defaultPicId": proj.defaultPicId
                              }
                            },function(err,resp,status) {
                                if(err) { console.log(err);} else {

                                //stored
                                }

                            });
</code></pre>