# Update a specific nested object field in Elasticsearch

**URL:** https://discuss.elastic.co/t/update-a-specific-nested-object-field-in-elasticsearch/57255
**Category:** Elasticsearch
**Created:** [August 4, 2016, 4:39pm UTC](https://discuss.elastic.co/t/update-a-specific-nested-object-field-in-elasticsearch/57255 "2016-08-04T16:39:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dawit](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@Dawit](https://discuss.elastic.co/u/Dawit)
#### Post date: [August 4, 2016, 4:39pm UTC](https://discuss.elastic.co/t/update-a-specific-nested-object-field-in-elasticsearch/57255/1 "2016-08-04T16:39:22Z")

</div>

I have a nestee index and a nested object under it  
I wold like to update a nested object field and I am using a script to make that happen.  
The issue is when I use the script, I don't know how to specify a single nested object document using a unique identifier field.

This is my script:

(using sense)  
POST nestee/nestee/\_bulk  
{ "update" : { "\_id" : "2139", "\_type" : "nestee", "\_index" : "nestee", "\_retry\_on\_conflict" : 3} }  
{ "script" : "ctx.\_source.nestedobject= param1", "params" : { "param1" : {"UpdatingField": "299535"} },"upsert":"param1"}

That works fine, but it is wrong because I have multiple nested objects under that nestee \_id 2139 and I wanted to pass the unique identifier nested object id (nestedobjectID) field when I am posting that update. How can I please do that? I am fairly new for Elasticsearch.

---

<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 5, 2017, 10:30pm UTC](https://discuss.elastic.co/t/update-a-specific-nested-object-field-in-elasticsearch/57255/2 "2017-07-05T22:30:02Z")

</div>


