Select in nested findMany query ?
Hi, I need some help with part of my code
I have
"items": [ { "items": { "id": 8, "name": "novinky", "slug": "novinky", "content": "" } }, .... another "items" ] but i want items: [ {item1} , {item2} ] is it possible ?
many-to-many
relation between two tables items
and subcategories
and third relation table named itemsToSubCategoriesTable
I get the response as expected with nested with
statement
but the result is"items": [ { "items": { "id": 8, "name": "novinky", "slug": "novinky", "content": "" } }, .... another "items" ] but i want items: [ {item1} , {item2} ] is it possible ?
2 Replies
It will be possible in relational API v2. For now you have to process the result in application code, something like result.items.map(item => item.items)
Thank you, I did it that way, but wasn't sure if it's ok like that or i missed something in docs, looking forward for v2 🙂