# Update Nested array, Fields Error

**URL:** <https://discuss.elastic.co/t/update-nested-array-fields-error/91070>\
**Category:** Elasticsearch\
**Created:** [June 28, 2017, 9:21am UTC](https://discuss.elastic.co/t/update-nested-array-fields-error/91070 "2017-06-28T09:21:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![contentsme](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@contentsme](https://discuss.elastic.co/u/contentsme)\
**Post date:** [June 28, 2017, 9:21am UTC](https://discuss.elastic.co/t/update-nested-array-fields-error/91070/1 "2017-06-28T09:21:34Z")

</div>

Hi i'm facing an error during update nested field this is the following info on my setup:

**my index has this structure:**  
{  
"mappings": {  
"profile": {  
"properties": {  
"account": {  
"properties": {  
"username": {  
"type": "text"  
},  
"password": {  
"type": "text"  
},  
"email": {  
"type": "text"  
},  
"isAdmin": {  
"type": "boolean"  
},  
"isActive": {  
"type": "boolean"  
},  
"last\_activity": {  
"type": "date"  
},  
"isPaymentSet": {  
"type": "boolean"  
},  
"isBillingSet": {  
"type": "boolean"  
},  
"isDetailSet": {  
"type": "boolean"  
}  
}  
},  
"staff": {  
"type": "nested",  
"properties": {  
"fname": {  
"type": "text"  
},  
"lname": {  
"type": "text"  
},  
"position": {  
"type": "text"  
},  
"bio": {  
"type": "text"  
},  
"avatar": {  
"type": "text"  
}  
}  
}  
}  
}  
}  
}

document inserted body:

{  
"region": "AU",  
"account": {  
"username": account['username'],  
"password": account['password'],  
"email": account['email'],  
"isAdmin": False,  
"isActive": True,  
"isPayment": False,  
"isBilling": False,  
"isDetail": False,  
"last\_activity": "2017-07-07"  
},  
"customer": [  
{  
"firstname": customer['firstname'],  
"lastname": customer['lastname'],  
"strip" : "",  
"address" : "",  
"company" : "",  
"street" : "",  
"street\_2" : "",  
"city" : "",  
"state" : "",  
"zip" : "",  
"country" : "",

```
        }
      ]}

```

with that i'm trying to update a field of zip under the customer is it possible to achieve that i had tried this Update query:

{  
"script": {  
"inline": "ctx.\_source.customer.add(params.zip)",  
"params": {  
"customer": {  
"zip": "hello"  
}  
}  
}  
}  
the response:  
HTTP/1.1 200 OK  
content-type: application/json; charset=UTF-8  
content-length: 147

{"\_index":"account","\_type":"profile","\_id":"AVzt5KpDxjBnZ439EbPh","\_version":6,"result":"updated","\_shards":{"total":2,"successful":1,"failed":0}}

but there is no update for the zip field, please help

---

<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 26, 2017, 9:21am UTC](https://discuss.elastic.co/t/update-nested-array-fields-error/91070/2 "2017-07-26T09:21:40Z")

</div>

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