#help with query string for filtering a collection

1 messages · Page 1 of 1 (latest)

torn summit
#

im struggling to get this filtering working, basically i want to filter on two different fields, im getting the first of these queries to work:

works: http://localhost:3000/api/mainPages?where[pageLayout.blockType][equals]=projectPageBlock
doesnt work: http://localhost:3000/api/mainPages?where[pageLayout.relCategories.slug][equals]=testslug

blockType is a string, relCategories is a relational field (array) with slug text fields

if i can get them to work separately i can at least combine them after i believe with a simple &

carmine ruinBOT
#

Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:

Documentation:

Community-Help:

maiden edge
#

Hey I strongly recommand you to use the qs lib to create your query, like on the doc

torn summit
#

fair enough, but the problem remains the same, this issue is how to express the filter request

#

this would be the query im thinking, but no luck, same result:

const query = {
'pageLayout.blockType': {
equals: 'projectPageBlock'
},
and: [
{
'pageLayout.relCategories.slug': {
equals: 'arkitektur'
}
}
]
};