{
name: '_trip',
label: 'Spotlight Trips',
limit:4,
type: 'joinByArray',
withType: 'trip',
},
{
name: '_accommodation',
label: 'Spotlight Accommodations',
type: 'joinByArray',
withType: 'accommodation',
limit:2,
},
{
name: '_testimonial',
label: 'Testimonials',
type: 'joinByArray',
withType: 'testimonial'
},
The json given given below is a portion of the data retrived.I want to get the data of accommodation and trips which is another piece , But instead here its id's are shown.
"_home-spotlight": [
{
"_id": "cki5owqrv008obgundta0x6rp",
"published": true,
"trash": false,
"type": "home-spotlight",
"title": "spotlightAbove",
"tripIds": [
"cki5oqi7r0063bgun81o6umqd"
],
"accommodationIds": [
"cki5owga1008mbgunlxweuera"
],
Currently, ApostropheCMS has no way to fetch contents from inner joins (that is, the collection joins has another collection joined) through Rest API. For now, we will get only the IDs of that collection. So as, alexbea said, we have to do an another additional API call to fetch that collection using the IDs.
Those who are not using Rest API can fetch these collections using withJoins
[https://docs.apostrophecms.org/reference/field-types/joinbyarray.html#settings].