# Can we update or delete document in ES latest version 6.3.2

**URL:** <https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176>\
**Category:** Elasticsearch\
**Created:** [August 13, 2018, 1:04pm UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176 "2018-08-13T13:04:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RameshNagargoje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshnagargoje/32/30212_2.png) [@RameshNagargoje](https://discuss.elastic.co/u/RameshNagargoje)\
**Post date:** [August 13, 2018, 1:04pm UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176/1 "2018-08-13T13:04:23Z")

</div>

```
Hi,
I want to update existing documents as like sql query with where clause.
UPDATE CUSTOMERS
SET ADDRESS = 'Pune'
WHERE ID = 6;

And how we can delete documents as like sql quey 

DELETE FROM *table_name*
WHERE *condition* ;

I have checked on elasti.co documents but there it used document id, But I dont want to used document id, Need to used search and use delete and update.
```

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [August 13, 2018, 1:10pm UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176/2 "2018-08-13T13:10:26Z")

</div>

Why don't you use native elastic delete statement.  
There you can use `where`.

And it's usage is quite simple.

---

<div class="post-metadata">

**Author:** ![Teja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teja/32/16324_2.png) [@Teja](https://discuss.elastic.co/u/Teja)\
**Post date:** [August 13, 2018, 1:28pm UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176/3 "2018-08-13T13:28:09Z")

</div>

You can you use [\_update\_by\_query](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/docs-update-by-query.html) and [\_delete\_by\_query](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/docs-delete-by-query.html)

---

<div class="post-metadata">

**Author:** ![RameshNagargoje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshnagargoje/32/30212_2.png) [@RameshNagargoje](https://discuss.elastic.co/u/RameshNagargoje)\
**Post date:** [August 14, 2018, 4:52am UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176/4 "2018-08-14T04:52:38Z")

</div>

Thanks a lot @Teja and @Mojster it worked.

---

<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:** [September 11, 2018, 4:53am UTC](https://discuss.elastic.co/t/can-we-update-or-delete-document-in-es-latest-version-6-3-2/144176/5 "2018-09-11T04:53:00Z")

</div>

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