# Nuxt : query with muliples Predicates

**URL:** <https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [March 14, 2023, 2:06pm UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674 "2023-03-14T14:06:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricou](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/ricou/32/4224_2.png) [@ricou](https://community.prismic.io/u/ricou)\
**Post date:** [March 14, 2023, 2:06pm UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674/1 "2023-03-14T14:06:42Z")

</div>

Hi,  
In my slice, I want to retrieve all the "clubs" (customtype : clubcustomtype) which the field "niveaulabellisation" is equal to 1

If I don't filter on the "niveaulabellisation", everything works fine :

> async fetch() {  
> try {  
> let localeForPrismic = 'fr-fr'  
> if (this.$i18n.locale === 'en') {  
> localeForPrismic = 'en-us'  
> }
> 
> ```
> const clubs = await this.$prismic.api.query(
> [
> this.$prismic.predicates.at('document.type', 'clubcustomtype'),
> ],
> {
> lang: localeForPrismic,
> orderings: '[my.clubcustomtype.datelabellisation desc]',
> pageSize: 2,
> page: this.pageNumber,
> }
> )
> 
> this.clubs = clubs
> } catch (e) {
> console.error(e)
> }
> 
> ```
> 
> },

But When I add the filter :

> async fetch() {  
> try {  
> let localeForPrismic = 'fr-fr'  
> if (this.$i18n.locale === 'en') {  
> localeForPrismic = 'en-us'  
> }
> 
> ```
> const clubs = await this.$prismic.api.query(
> [
> this.$prismic.predicates.at('document.type', 'clubcustomtype'),
> 
> this.$prismic.predicates.at(
> 'my.clubcustomtype.niveaulabellisation',
> 1
> ),
> ],
> {
> lang: localeForPrismic,
> orderings: '[my.clubcustomtype.datelabellisation desc]',
> pageSize: 2,
> page: this.pageNumber,
> }
> )
> 
> // my.club.niveaulabellisation
> 
> this.clubs = clubs
> } catch (e) {
> console.error(e)
> }
> 
> ```
> 
> },

Primic API returns an error :  
[https://fairplayforplanet.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=2&lang=fr-fr&orderings=[my.clubcustomtype.datelabellisation%20desc]&ref=ZBB2OhAAACoAzSpg&q=[[at(document.type%2C%20"clubcustomtype")][at(my.clubcustomtype.niveaulabellisation%2C%201)]]](https://fairplayforplanet.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=2&lang=fr-fr&orderings=%5Bmy.clubcustomtype.datelabellisation%20desc%5D&ref=ZBB2OhAAACoAzSpg&q=%5B%5Bat(document.type%2C%20%22clubcustomtype%22)%5D%5Bat(my.clubcustomtype.niveaulabellisation%2C%201)%5D%5D)

Her is my customtype

> {  
> "id": "clubcustomtype",  
> "label": "Club",  
> "repeatable": true,  
> "status": true,  
> "json": {  
> "Main": {  
> "logo": {  
> "type": "Image",  
> "config": {  
> "label": "logo",  
> "constraint": {  
> "width": 300  
> },  
> "thumbnails":   
> }  
> },  
> "nom": {  
> "type": "Text",  
> "config": {  
> "label": "nom",  
> "placeholder": ""  
> }  
> },  
> "scoretotal": {  
> "type": "Text",  
> "config": {  
> "label": "scoreTotal",  
> "placeholder": ""  
> }  
> },  
> "scorepreservationenvironnement": {  
> "type": "Text",  
> "config": {  
> "label": "scorePreservationEnvironnement",  
> "placeholder": ""  
> }  
> },  
> "scoreecoperformer": {  
> "type": "Text",  
> "config": {  
> "label": "scoreEcoperformer",  
> "placeholder": ""  
> }  
> },  
> "scorerolesocietal": {  
> "type": "Text",  
> "config": {  
> "label": "scoreRoleSocietal",  
> "placeholder": ""  
> }  
> },  
> "datelabellisation": {  
> "type": "Date",  
> "config": {  
> "label": "dateLabellisation",  
> "placeholder": ""  
> }  
> },  
> "niveaulabellisation": {  
> "type": "Select",  
> "config": {  
> "label": "niveauLabellisation",  
> "placeholder": "",  
> "options": [  
> "1",  
> "2",  
> "3"  
> ]  
> }  
> },  
> "sport": {  
> "type": "Text",  
> "config": {  
> "label": "sport",  
> "placeholder": ""  
> }  
> }  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![ricou](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/ricou/32/4224_2.png) [@ricou](https://community.prismic.io/u/ricou)\
**Post date:** [March 15, 2023, 10:09am UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674/3 "2023-03-15T10:09:59Z")

</div>

Can anyone help me? I am stuck ☹

---

<div class="post-metadata">

**Author:** ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)\
**Post date:** [March 15, 2023, 11:45am UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674/4 "2023-03-15T11:45:11Z")

</div>

Hello @ricou,

My apologies for just responding.

After debugging the issue and looking at your Customtype, I can see that the niveauLabellisation options are strings, and you are filtering with 1 as a number and not as a string "1".

Let me know if it works for you.

Thanks,  
Racheal.

---

<div class="post-metadata">

**Author:** ![ricou](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/ricou/32/4224_2.png) [@ricou](https://community.prismic.io/u/ricou)\
**Post date:** [March 15, 2023, 12:44pm UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674/6 "2023-03-15T12:44:34Z")

</div>

Hello @racheal.orukele ,

well seen !  
It works perfectly now.  
Thanks again!  
Prismic Team at the top!

---

<div class="post-metadata">

**Author:** ![racheal.orukele](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal.orukele](https://community.prismic.io/u/racheal.orukele)\
**Post date:** [March 15, 2023, 12:48pm UTC](https://community.prismic.io/t/nuxt-query-with-muliples-predicates/12674/7 "2023-03-15T12:48:48Z")

</div>

@ricou I'm glad to hear that. Let us know if you have any other questions.
