# Append update to a document

**URL:** <https://discuss.elastic.co/t/append-update-to-a-document/235834>\
**Category:** Elasticsearch\
**Created:** [June 4, 2020, 6:14pm UTC](https://discuss.elastic.co/t/append-update-to-a-document/235834 "2020-06-04T18:14:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Susmit07](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/susmit07/32/47309_2.png) [@Susmit07](https://discuss.elastic.co/u/Susmit07)\
**Post date:** [June 4, 2020, 6:14pm UTC](https://discuss.elastic.co/t/append-update-to-a-document/235834/1 "2020-06-04T18:14:01Z")

</div>

Hello team,

I have a document and also have a unique id field, first time it inserts 10 data based on the docId, secondTime it has again 15 data with same docId again so docId is the primaryKey (in the context of RDBMS), any java snippet if can be provided so i can have all 25 records with a single docId that would be of great help .. I know the scripts way, but now I am searching to do the same with Java code.

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 5, 2020, 5:38am UTC](https://discuss.elastic.co/t/append-update-to-a-document/235834/2 "2020-06-05T05:38:27Z")

</div>

> [@Susmit07](#):
>
> I know the scripts way

Can you show how you are doing this so we know how you expect it 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:** [July 3, 2020, 5:38am UTC](https://discuss.elastic.co/t/append-update-to-a-document/235834/3 "2020-07-03T05:38:28Z")

</div>

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