# Is it possible to use updateByQuery and deleteByQuery on nested documents?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227>\
**Category:** Elasticsearch\
**Created:** [June 8, 2016, 3:07pm UTC](https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227 "2016-06-08T15:07:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohannad\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Mohannad\_Saeed](https://discuss.elastic.co/u/Mohannad_Saeed)\
**Post date:** [June 8, 2016, 3:07pm UTC](https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227/1 "2016-06-08T15:07:45Z")

</div>

Greetings,

Is it possible to use updateByQuery and deleteByQuery to update/delete nested documents?

Kind regards

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 8, 2016, 3:20pm UTC](https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227/2 "2016-06-08T15:20:37Z")

</div>

They should work, yes. We test parent/child and routing with those features but I don't think we have explicit testing around nested docs. It should still work though.

---

<div class="post-metadata">

**Author:** ![Mohannad\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Mohannad\_Saeed](https://discuss.elastic.co/u/Mohannad_Saeed)\
**Post date:** [June 8, 2016, 3:42pm UTC](https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227/3 "2016-06-08T15:42:38Z")

</div>

Thank you for your quick response.

What I meant is to use updateByQuery and deleteByQuery without scripts to update/delete nested documents exactly like how we would use it with root documents. Is it possible?

---

<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:** [July 5, 2017, 10:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-use-updatebyquery-and-deletebyquery-on-nested-documents/52227/4 "2017-07-05T22:45:17Z")

</div>


