# Update fields of a doc from another doc according to key field

**URL:** <https://discuss.elastic.co/t/update-fields-of-a-doc-from-another-doc-according-to-key-field/160240>\
**Category:** Elasticsearch\
**Created:** [December 10, 2018, 8:04pm UTC](https://discuss.elastic.co/t/update-fields-of-a-doc-from-another-doc-according-to-key-field/160240 "2018-12-10T20:04:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnz](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@dnz](https://discuss.elastic.co/u/dnz)\
**Post date:** [December 10, 2018, 8:04pm UTC](https://discuss.elastic.co/t/update-fields-of-a-doc-from-another-doc-according-to-key-field/160240/1 "2018-12-10T20:04:05Z")

</div>

Hello,

I have one type of doc. Each doc has a filled field, "guid". And on some of the docs the field "operationName" is filled, any on the others this field is empty. I need to update this empty "operationName" field according to "guid" field. How can I update this field, or relate this docs ?

doc type 1:

{  
guid : 100  
operationName : "operation1"   
}

doc type 2 :  
{  
guid : 100  
operationName :  
}

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:** [January 7, 2019, 8:04pm UTC](https://discuss.elastic.co/t/update-fields-of-a-doc-from-another-doc-according-to-key-field/160240/2 "2019-01-07T20:04:08Z")

</div>

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