# Change one element array to structure

**URL:** <https://discuss.elastic.co/t/change-one-element-array-to-structure/221878>\
**Category:** Elasticsearch\
**Created:** [March 3, 2020, 12:06pm UTC](https://discuss.elastic.co/t/change-one-element-array-to-structure/221878 "2020-03-03T12:06:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MMH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mmh/32/54449_2.png) [@MMH](https://discuss.elastic.co/u/MMH)\
**Post date:** [March 3, 2020, 12:06pm UTC](https://discuss.elastic.co/t/change-one-element-array-to-structure/221878/1 "2020-03-03T12:06:29Z")

</div>

I am using Elasticsearch 6.5.

In one of the indexes in the documents, there is a field, that should always be a structure.  
Because of error in the loading scripts for some of the documents data in this field was inserted as one element array which contains target structure.  
Is there an easy way to convert these one-element arrays of structures just to structure? I know the fields of the structure beforehand, but I do not know IDs of documents, that need such change.

---

<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:** [March 31, 2020, 12:06pm UTC](https://discuss.elastic.co/t/change-one-element-array-to-structure/221878/2 "2020-03-31T12:06:31Z")

</div>

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