# Error writing array of objects?

**URL:** <https://discuss.elastic.co/t/error-writing-array-of-objects/180842>\
**Category:** Elasticsearch\
**Created:** [May 13, 2019, 3:39pm UTC](https://discuss.elastic.co/t/error-writing-array-of-objects/180842 "2019-05-13T15:39:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lvic](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@lvic](https://discuss.elastic.co/u/lvic)\
**Post date:** [May 13, 2019, 3:39pm UTC](https://discuss.elastic.co/t/error-writing-array-of-objects/180842/1 "2019-05-13T15:39:01Z")

</div>

Hello, I am trying to create mapping for the array of objects:  
"my\_vector" : [  
{  
"my\_id": "2c5f056d-4ab9-4aff-85b6-be16a6d26fb2",  
"my\_name": "test1",  
"my\_value": [  
{  
"name": "state",  
"value": 0,  
"cc\_value": 0.81  
},  
{  
"name": "test2",  
"value": 0,  
"cc\_value": 0.71  
}  
]  
}  
I used map "my\_vector":{"type": "keyword"} to create index with mappings, but when I try to create type with real data, i have the following error:  
{"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse [my\_vector]"}],"type":"mapper\_parsing\_exception","reason":"failed to parse [my\_vector]","caused\_by":{"type":"illegal\_state\_exception","reason":"Can't get text on a START\_OBJECT at 1:83"}}  
What the mapping for array should look like? Thanks....

---

<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:** [June 10, 2019, 3:39pm UTC](https://discuss.elastic.co/t/error-writing-array-of-objects/180842/2 "2019-06-10T15:39:14Z")

</div>

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