# I can't order using query method

**URL:** <https://community.prismic.io/t/i-cant-order-using-query-method/13440>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [June 14, 2023, 8:05am UTC](https://community.prismic.io/t/i-cant-order-using-query-method/13440 "2023-06-14T08:05:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cerrutti](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/cerrutti/32/2908_2.png) [@cerrutti](https://community.prismic.io/u/cerrutti)\
**Post date:** [June 14, 2023, 8:05am UTC](https://community.prismic.io/t/i-cant-order-using-query-method/13440/1 "2023-06-14T08:05:39Z")

</div>

Hi,

I'm getting an error when trying to order using the query method in Nuxt 2.

```auto
{"type":"api_parsing_error","message":"']' expected but 'a' found on line:1 col:27 in query '[[at(document.type, \"book\")][at(my.book.subjects.subject, \"YIQbLBEAACUAbI2q\")]]'\n[[at(document.type, \"book\")][at(my.book.subjects.subject, \"YIQbLBEAACUAbI2q\")]]\n ^\n","pos":{"line":1,"column":27,"location":"ordering"}}

```

The code I'm using:

```auto
const books = await $prismic.api.query(
  [
    $prismic.predicates.at('document.type', 'book'),
    $prismic.predicates.at('my.book.subjects.subject', doc.id)
  ],
  {
    orderings: '[my.book.author_last_name asc]'
  }
)

```

That query works without the params object, just with predicates.  
I also tried to use object-type orderings with field and direction keys, and have the same issue.  
I'm using the same query call for other custom type and it's working, so something is wrong about this custom type? The only difference is right before I'm doing another call:

```auto
const doc = await $prismic.api.getByUID('subject', params.slug)

```

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [June 14, 2023, 9:33am UTC](https://community.prismic.io/t/i-cant-order-using-query-method/13440/3 "2023-06-14T09:33:25Z")

</div>

Hello @cerrutti

Thanks for reaching out to us.

The query looks good to me. Can you send me the repo name in a private message so I can check on my end?

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![cerrutti](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/cerrutti/32/2908_2.png) [@cerrutti](https://community.prismic.io/u/cerrutti)\
**Post date:** [June 15, 2023, 9:24am UTC](https://community.prismic.io/t/i-cant-order-using-query-method/13440/5 "2023-06-15T09:24:25Z")

</div>

Ok, Priyanka helped me to fix this, "asc" ordering is the default so we don't need to use it.  
Thank you!

---

<div class="post-metadata">

**Author:** ![Priyanka](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/priyanka/32/3223_2.png) [@Priyanka](https://community.prismic.io/u/Priyanka)\
**Post date:** [June 15, 2023, 9:25am UTC](https://community.prismic.io/t/i-cant-order-using-query-method/13440/6 "2023-06-15T09:25:28Z")

</div>

By default, the results will be ordered from lowest to highest, so you don't need to asc order.  
I haven't added ASC in my query; a NULL value comes before any non-NULL value.
