# Looking for example of how to do bulk UPDATE or UPSERT with custom \_id in v5.6.\*

**URL:** <https://discuss.elastic.co/t/looking-for-example-of-how-to-do-bulk-update-or-upsert-with-custom-id-in-v5-6/105111>\
**Category:** Elasticsearch\
**Created:** [October 24, 2017, 6:33pm UTC](https://discuss.elastic.co/t/looking-for-example-of-how-to-do-bulk-update-or-upsert-with-custom-id-in-v5-6/105111 "2017-10-24T18:33:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bw2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bw2/32/25266_2.png) [@bw2](https://discuss.elastic.co/u/bw2)\
**Post date:** [October 24, 2017, 6:33pm UTC](https://discuss.elastic.co/t/looking-for-example-of-how-to-do-bulk-update-or-upsert-with-custom-id-in-v5-6/105111/1 "2017-10-24T18:33:49Z")

</div>

I have an existing index and want to add several fields to the mapping, and then use UPDATE or UPSERT to add the data.  
What is the correct way to run bulk UPSERT or UPDATE with a custom key (eg. lets say I want to use a custom UUID string instead of the default \_id integer)?

Submitting documents like { \_id: "my-uuid1", key1: value1, ...} doesn't seem to work.

---

<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:** [November 21, 2017, 6:33pm UTC](https://discuss.elastic.co/t/looking-for-example-of-how-to-do-bulk-update-or-upsert-with-custom-id-in-v5-6/105111/2 "2017-11-21T18:33:58Z")

</div>

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