# Transforming JSON to match Elasticsearch Query DSL

**URL:** https://discuss.elastic.co/t/transforming-json-to-match-elasticsearch-query-dsl/40995
**Category:** Elasticsearch
**Created:** [February 4, 2016, 6:16pm UTC](https://discuss.elastic.co/t/transforming-json-to-match-elasticsearch-query-dsl/40995 "2016-02-04T18:16:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![flx](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@flx](https://discuss.elastic.co/u/flx)
#### Post date: [February 4, 2016, 6:16pm UTC](https://discuss.elastic.co/t/transforming-json-to-match-elasticsearch-query-dsl/40995/1 "2016-02-04T18:16:09Z")

</div>

I am trying to process MongoDB queries that come in a JSON format that looks like that:

```
{ "$or": [{"id":"string"},{"field":"string"}] }

```

What do you think would be the best way to transform those queries to match the Elasticsearch Java API?

---

<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: [July 5, 2017, 11:07pm UTC](https://discuss.elastic.co/t/transforming-json-to-match-elasticsearch-query-dsl/40995/2 "2017-07-05T23:07:34Z")

</div>


