# Sort by combination of fields in Javascript API

**URL:** <https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524>\
**Category:** Developing with Prismic\
**Tags:** product-feature-idea, javascript\
**Created:** [May 25, 2020, 10:10am UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524 "2020-05-25T10:10:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrkuepper](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/rrkuepper/32/239_2.png) [@rrkuepper](https://community.prismic.io/u/rrkuepper)\
**Post date:** [May 25, 2020, 10:10am UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524/1 "2020-05-25T10:10:19Z")

</div>

hi there

i'm querying the api via:

i'm querying the javascript api via:

```
const queryData = await this.$prismic.api.query(
    [
      this.$prismic.predicates.any('document.type', ['news', 'press'])
    ],
    {
      orderings: '[my.news.date desc, my.press.date desc]',
      pageSize: 100, // max pageSize
      page: pageNumber
    }
  )

```

press-items and news-items both have a "date" field on them.

the ordering currently orders all results by news.date and THEN by press.date which leads to all the press-results being returned first.

How can I sort all of the results by date? So that the results are a list of news and press-items both sorted by date? Something like "my.any.date"?

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [May 25, 2020, 12:08pm UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524/2 "2020-05-25T12:08:28Z")

</div>

Hi @rrkuepper, unfortunately it isn’t possible to order your results by a Date field across different custom types. This is something I would love to see myself, and I’ve added another tick for this in our feature request tracker as a possible improvement for the future.

For now, you’ll need to organize the results in your website app after querying.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 21, 2020, 3:31pm UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524/4 "2020-09-21T15:31:50Z")

</div>

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the ❤ button to show your support for the feature and check out our [Feature Request Guidelines](https://community.prismic.io/t/feature-requests-what-do-you-already-love-what-could-be-better/844).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:16pm UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524/5 "2021-12-09T17:16:33Z")

</div>



---

<div class="post-metadata">

**Author:** ![manuel1](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/manuel1/32/5159_2.png) [@manuel1](https://community.prismic.io/u/manuel1)\
**Post date:** [August 24, 2023, 8:44pm UTC](https://community.prismic.io/t/sort-by-combination-of-fields-in-javascript-api/524/6 "2023-08-24T20:44:38Z")

</div>

Is there any update on this? I'm facing the same issue
