# MongoDB (5+, json based) : some objects have variable types

**URL:** <https://discuss.elastic.co/t/mongodb-5-json-based-some-objects-have-variable-types/312445>\
**Category:** Logstash\
**Created:** [August 19, 2022, 8:26am UTC](https://discuss.elastic.co/t/mongodb-5-json-based-some-objects-have-variable-types/312445 "2022-08-19T08:26:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 19, 2022, 9:48pm UTC](https://discuss.elastic.co/t/mongodb-5-json-based-some-objects-have-variable-types/312445/3 "2022-08-19T21:48:02Z")

</div>

> [@LaBonave](#):
>
> Is there a way, at the filter (or filebeat maybe) not to parse recursively some JSON documents.

Not that I know of. However, you can serialize some of the objects.

```
ruby { code => 'event.set("[attr][command]", event.get("[attr][command]").to_s)' }

```

---

_[View the full topic](https://discuss.elastic.co/t/mongodb-5-json-based-some-objects-have-variable-types/312445)._
