# Partial update a field of nested object in list of nested object

**URL:** https://discuss.elastic.co/t/partial-update-a-field-of-nested-object-in-list-of-nested-object/63033
**Category:** Elasticsearch
**Created:** [October 14, 2016, 8:03am UTC](https://discuss.elastic.co/t/partial-update-a-field-of-nested-object-in-list-of-nested-object/63033 "2016-10-14T08:03:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Prannoy\_Mittal](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@Prannoy\_Mittal](https://discuss.elastic.co/u/Prannoy_Mittal)
#### Post date: [October 14, 2016, 8:03am UTC](https://discuss.elastic.co/t/partial-update-a-field-of-nested-object-in-list-of-nested-object/63033/1 "2016-10-14T08:03:38Z")

</div>

Suppose i have a field list of users:

One sample document in particular index  
{ "\_id":100, "users" : {'name':'manu','age':20,'followers':[3,2,4]},{'name':'prannoy','age':24,'followers':[3,4,53,23,56]}}

For following use case:

Add a new entry in followers , where name is manu

For above use case:

1. Add a new entry in followers , where name is manu  
Does elasticsearch support script over nested fields  
if [users.name](http://users.name) == "manu" then users.followes += 20 (it should update only required entry in nested users field)

Is there any other way ?

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [October 14, 2016, 2:58pm UTC](https://discuss.elastic.co/t/partial-update-a-field-of-nested-object-in-list-of-nested-object/63033/2 "2016-10-14T14:58:06Z")

</div>

The update API is not aware of mappings, it is directly operating on the source document. Your solution sounds appropriate to me.

---

<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:12pm UTC](https://discuss.elastic.co/t/partial-update-a-field-of-nested-object-in-list-of-nested-object/63033/3 "2017-07-05T22:12:14Z")

</div>


