Nested Object insert/update

Hi Everyone:

Below nested update does not insert a new nested object in the array, Notice the added brackets [ ]

curl -XPOST 'http://localhost:9200/v2/Test/cd196e01/_update' -d'{"script":"ctx._source.Code += Code",
"Description":"Some updates",
"SourceValue":"some value",

Getting error msg:

{"error":"ElasticsearchIllegalArgumentException[failed to execute script]; nested: GroovyScriptExecutionException[ClassCastException[java.util.HashMap cannot be cast to java.util.Map$Entry]

However, removing the brackets [ ] will update the existing nested object. Need to insert nested object instead.

Any help is much appreciated !!

Thank You

Hi, did u manage to fix that?