# Partial Update Multi Level Nested Document

**URL:** https://discuss.elastic.co/t/partial-update-multi-level-nested-document/94329
**Category:** Elasticsearch
**Created:** [July 24, 2017, 12:51pm UTC](https://discuss.elastic.co/t/partial-update-multi-level-nested-document/94329 "2017-07-24T12:51:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Orijit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orijit/32/3503_2.png) [@Orijit](https://discuss.elastic.co/u/Orijit)
#### Post date: [July 24, 2017, 12:51pm UTC](https://discuss.elastic.co/t/partial-update-multi-level-nested-document/94329/1 "2017-07-24T12:51:02Z")

</div>

Hi

Using Elasticsearch 1.7.1, I have the following document structure

```
"_source" : {
"questions" : {
	"defaultQuestion" : {			
		"tag" : 0,
		"gid" : 0,
		"rid" : 0,
		"caption" : "SRID",			
	},
	"tableQuestion" : {
		"rows" : [{
				"ids" : {						
					"answerList" : ["3547", "3548"],						
					"tag" : "0",
					"caption" : "Accounts",						
				},
				"name" : {						
					"answerList" : ["Some Name"],						
					"tag" : "0",
					"caption" : "Name",						
				}
			}
		],
		"caption" : "BPI 1500541753537",
		"id" : 644251570,
		"tag" : ""
	}
},
"id" : "447722821"	
}

```

I want to add a new object in in questions.tableQuestion.rows. My current script is

```
{ "update": {"_id": "935663867", "_retry_on_conflict" : 3} }
{ "script" : "ctx._source.questions += param1", "params" : {"param1" : {"tableQuestion": {"rows" : [NEWROWOBJECT]} } }}

```

This is replacing the existing object with the new one. Kindly suggest how to append it.

Thanks  
Orijit

---

<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: [August 21, 2017, 12:51pm UTC](https://discuss.elastic.co/t/partial-update-multi-level-nested-document/94329/2 "2017-08-21T12:51:18Z")

</div>

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