# Nested Array to Query Params

**URL:** <https://discuss.emberjs.com/t/nested-array-to-query-params/17373>\
**Category:** Ember Data\
**Created:** [December 27, 2019, 2:05am UTC](https://discuss.emberjs.com/t/nested-array-to-query-params/17373 "2019-12-27T02:05:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wukongrita](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/wukongrita/32/16645_2.png) [@wukongrita](https://discuss.emberjs.com/u/wukongrita)\
**Post date:** [December 27, 2019, 2:05am UTC](https://discuss.emberjs.com/t/nested-array-to-query-params/17373/1 "2019-12-27T02:05:00Z")

</div>

Hi, I have:

```auto
[
    {
        id: // the field to be search
            {
                eq: '1234' // eq is the operand; 1234 is the keyword
            }
    },
    {
        description:
            {
                like: 'desc'
            }
    }
]

```

How to transform it to query parameters to:

```auto
?filter[id][eq]=1234&filter[description][like]=desc

```

since the API needed the format like so for the filters?

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [December 31, 2019, 5:58pm UTC](https://discuss.emberjs.com/t/nested-array-to-query-params/17373/2 "2019-12-31T17:58:27Z")

</div>

You could try overriding `urlForQuery` in your adapter (docs [here](https://api.emberjs.com/ember-data/3.15/classes/JSONAPIAdapter/methods/urlForQuery?anchor=urlForQuery)). Of course that is assuming you are using Ember Data, if not you should be able to build the URL manually.
