# Elasticsearch nodejs client update function

**URL:** <https://discuss.elastic.co/t/elasticsearch-nodejs-client-update-function/210560>\
**Category:** Elasticsearch\
**Created:** [December 4, 2019, 3:29pm UTC](https://discuss.elastic.co/t/elasticsearch-nodejs-client-update-function/210560 "2019-12-04T15:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jagadeesh\_ctm](https://avatars.discourse-cdn.com/v4/letter/j/e495f1/32.png) [@Jagadeesh\_ctm](https://discuss.elastic.co/u/Jagadeesh_ctm)\
**Post date:** [December 4, 2019, 3:29pm UTC](https://discuss.elastic.co/t/elasticsearch-nodejs-client-update-function/210560/1 "2019-12-04T15:29:25Z")

</div>

Hi  
I am using elastic-search java script client  
while i am writing a simple update command i am getting an error

```
 const EsResponse = await esClient.update({
      id: "dfsfsdfd213123XFTFG",
      index: "test",
      type: "_doc",
      body: { doc: { name: "update" } }
    });

```

The response error is

```
{
    "msg": "[invalid_type_name_exception] Document mapping type name can't start with '_', found: [_update]",
    "path": "/test/_update/dfsfsdfd213123XFTFG",
    "query": {
        "type": "_doc"
    },
    "body": "{\"doc\":{\"name\":\"update\"}}",
    "statusCode": 400,
    "response": "{\"error\":{\"root_cause\":[{\"type\":\"invalid_type_name_exception\",\"reason\":\"Document mapping type name can't start with '_', found: [_update]\"}],\"type\":\"invalid_type_name_exception\",\"reason\":\"Document mapping type name can't start with '_', found: [_update]\"},\"status\":400}"
}

```

I am using elasticsearch of version 6.3 can anyone help

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 1, 2020, 3:29pm UTC](https://discuss.elastic.co/t/elasticsearch-nodejs-client-update-function/210560/2 "2020-01-01T15:29:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
