# Unable to save the array of json object in elasticsearch. Need to save it as string

**URL:** <https://discuss.elastic.co/t/unable-to-save-the-array-of-json-object-in-elasticsearch-need-to-save-it-as-string/256557>\
**Category:** Elasticsearch\
**Created:** [November 24, 2020, 6:30pm UTC](https://discuss.elastic.co/t/unable-to-save-the-array-of-json-object-in-elasticsearch-need-to-save-it-as-string/256557 "2020-11-24T18:30:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saumya\_Mishra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saumya_mishra/32/47173_2.png) [@Saumya\_Mishra](https://discuss.elastic.co/u/Saumya_Mishra)\
**Post date:** [November 24, 2020, 6:30pm UTC](https://discuss.elastic.co/t/unable-to-save-the-array-of-json-object-in-elasticsearch-need-to-save-it-as-string/256557/1 "2020-11-24T18:30:46Z")

</div>

I want to save this kind of data as a **string** in elasticsearch, but it fails to save

`[{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"they "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"they qwe "},{"flag":0,"amt":-0.6811887,"code":0.5060151,"start":0,"end":0,"phrase":"i\\'m "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"i\\'m sd "},{"flag":0,"amt":-0.6072952,"code":0.5448225,"start":0,"end":0,"phrase":"i\\'m sd whatevrt "},{"flag":0,"amt":-0.8052968,"code":0.44695523,"start":0,"end":0,"phrase":"i\\'m sd whatevrt um "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"i\\'m sd whatevrt um mabe "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"i\\'m sd whatevrt um mabe with "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"i\\'m sd whatevrt um mabe with pool "},{"flag":0,"amt":0,"code":1,"start":0,"end":0,"phrase":"no "}]`

I tried the following mapping  
`"data": { "type": "object", "enabled": false },`

But didn't worked.

I am getting the following error while saving.

`"Unexpected character ('f' (code 102)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.common.bytes.AbstractBytesReference$MarkSupportingStreamInputWrapper@31222dc0; line: 3, column: 19]"`

Thanks in advance.

---

<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:** [December 22, 2020, 6:30pm UTC](https://discuss.elastic.co/t/unable-to-save-the-array-of-json-object-in-elasticsearch-need-to-save-it-as-string/256557/2 "2020-12-22T18:30:47Z")

</div>

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