# Modifying data to existing documents

**URL:** <https://discuss.elastic.co/t/modifying-data-to-existing-documents/135096>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 7:22am UTC](https://discuss.elastic.co/t/modifying-data-to-existing-documents/135096 "2018-06-08T07:22:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shekhar\_Pandey](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shekhar\_Pandey](https://discuss.elastic.co/u/Shekhar_Pandey)\
**Post date:** [June 8, 2018, 7:22am UTC](https://discuss.elastic.co/t/modifying-data-to-existing-documents/135096/1 "2018-06-08T07:22:29Z")

</div>

What I want try to do given by example:  
This below is first index  
PUT /customer/\_doc/1?pretty  
{  
"name": "John Doe"  
}  
Again, the above will index the specified document into the customer index, with the ID of 1. If we then executed the above command again with a different (or same) document, Elasticsearch will replace (i.e. reindex) a new document on top of the existing one with the ID of 1:

PUT /customer/\_doc/1?pretty  
{  
"name": "Jane Doe"  
}

The above changes the name of the document with the ID of 1 from "John Doe" to "Jane Doe". If, on the other hand, we use a different ID, a new document will be indexed and the existing document(s) already in the index remains untouched.

But I dont want as above result will show. I want both values become array like below:

PUT /customer/\_doc/1?pretty  
{  
"name": "Jane Doe",  
"name": "Jone Doe"  
}

Kindly tell me how I can do this to all documents.

Thank you.

---

<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 6, 2018, 7:22am UTC](https://discuss.elastic.co/t/modifying-data-to-existing-documents/135096/2 "2018-07-06T07:22:32Z")

</div>

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