# Only update selected fields if document alread exists

**URL:** <https://discuss.elastic.co/t/only-update-selected-fields-if-document-alread-exists/362375>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [July 2, 2024, 11:43am UTC](https://discuss.elastic.co/t/only-update-selected-fields-if-document-alread-exists/362375 "2024-07-02T11:43:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanwallenborg](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@johanwallenborg](https://discuss.elastic.co/u/johanwallenborg)\
**Post date:** [July 2, 2024, 11:43am UTC](https://discuss.elastic.co/t/only-update-selected-fields-if-document-alread-exists/362375/1 "2024-07-02T11:43:17Z")

</div>

I'm using IndexMany-method today and that updates if document with same ID alread exists. Is there any way except try to create and then index, to choose what fields that should be updated if document exists or maybe even better, exclude fields?

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [July 3, 2024, 8:27am UTC](https://discuss.elastic.co/t/only-update-selected-fields-if-document-alread-exists/362375/2 "2024-07-03T08:27:58Z")

</div>

Tags updated on July 3, 2024, 8:27am UTC

Added #language-clients
