# Appending object to an existing array of objects

**URL:** https://discuss.elastic.co/t/appending-object-to-an-existing-array-of-objects/47777
**Category:** Elasticsearch
**Created:** [April 19, 2016, 10:58am UTC](https://discuss.elastic.co/t/appending-object-to-an-existing-array-of-objects/47777 "2016-04-19T10:58:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sachinbrraj](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sachinbrraj](https://discuss.elastic.co/u/sachinbrraj)
#### Post date: [April 19, 2016, 10:58am UTC](https://discuss.elastic.co/t/appending-object-to-an-existing-array-of-objects/47777/1 "2016-04-19T10:58:41Z")

</div>

Elasticsearch version:2.2.1

JVM version: 7

OS version: CentOS 6.5

Description of the problem including expected versus actual behavior: I am trying to append a new object to an existing array of objects, but instead of appending, the whole array is replaced with the new value.

POST temp1  
{  
"mappings": {  
"conv": {  
"properties": {  
"name": {  
"type": "string"  
},  
"participants" : {  
"type": "nested",  
"properties": {  
"name" : {  
"type": "string"

},  
"nick":{  
"type": "string"  
}  
}  
}  
}  
}  
}  
}

POST /temp/conv/1/\_update  
{  
"script" : "ctx.\_source.participants += new\_creator",  
"params" : {  
"type" : "object",  
"new\_creator" : [{  
"name": "a", "nick": "nick-c" }]  
}  
}

Could you pls let me know whether this is a bug or am I doing it wrongly?

---

<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:58pm UTC](https://discuss.elastic.co/t/appending-object-to-an-existing-array-of-objects/47777/2 "2017-07-05T22:58:05Z")

</div>


