# Json codec vs. json\_lines codec for collecting mongoexport output JSON?

**URL:** <https://discuss.elastic.co/t/json-codec-vs-json-lines-codec-for-collecting-mongoexport-output-json/341616>\
**Category:** Logstash\
**Created:** [August 24, 2023, 8:25pm UTC](https://discuss.elastic.co/t/json-codec-vs-json-lines-codec-for-collecting-mongoexport-output-json/341616 "2023-08-24T20:25:34Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 25, 2023, 12:43am UTC](https://discuss.elastic.co/t/json-codec-vs-json-lines-codec-for-collecting-mongoexport-output-json/341616/9 "2023-08-25T00:43:59Z")

</div>

> [@paolovalladolid](#):
>
> Looks like my next step is decide on a solution for mapping explosion

From the document you shared it looks like the `tasks` field could be an issue, so you will probably need to map this field as a `flattened` field before creating your index.

This will make elasticsearch to store the entire json of the `tasks` obejct, but will create just one mapping.

---

_[View the full topic](https://discuss.elastic.co/t/json-codec-vs-json-lines-codec-for-collecting-mongoexport-output-json/341616)._
