# Painless Scripting

**URL:** <https://discuss.elastic.co/t/painless-scripting/284366>\
**Category:** Elasticsearch\
**Tags:** painless, ingest-pipeline\
**Created:** [September 16, 2021, 7:10am UTC](https://discuss.elastic.co/t/painless-scripting/284366 "2021-09-16T07:10:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![painless\_elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/painless_elastic/32/94652_2.png) [@painless\_elastic](https://discuss.elastic.co/u/painless_elastic)\
**Post date:** [September 16, 2021, 7:10am UTC](https://discuss.elastic.co/t/painless-scripting/284366/1 "2021-09-16T07:10:05Z")

</div>

Hi All,  
I am new to elastic search and trying to use ingest pipeline for modifying documents.  
I have a field in the document as JSON Array, I want to convert that into a string (Stringify JSON) and then save it into a new field.  
Is it possible to do this using ingest pipeline and how ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 16, 2021, 8:59am UTC](https://discuss.elastic.co/t/painless-scripting/284366/2 "2021-09-16T08:59:16Z")

</div>

Welcome!

Is there any reason you can not do that from the application which generates the document instead of adding a pre-process?

Then to answer you question, could you share a typical document you have as an input and how you would like it to be after the pipeline execution?

---

<div class="post-metadata">

**Author:** ![painless\_elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/painless_elastic/32/94652_2.png) [@painless\_elastic](https://discuss.elastic.co/u/painless_elastic)\
**Post date:** [September 21, 2021, 9:53am UTC](https://discuss.elastic.co/t/painless-scripting/284366/3 "2021-09-21T09:53:54Z")

</div>

Thanks, for the reply. Yes, it's not possible to do it on our couchbase server.

I have used the conversion processor to convert the JSON Array in my document to a String.

> **[Convert processor | Elasticsearch Guide \[7.14\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html)**

---

<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:** [October 19, 2021, 9:54am UTC](https://discuss.elastic.co/t/painless-scripting/284366/4 "2021-10-19T09:54:28Z")

</div>

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