撇号 cms 数据检索片段的连接与另一片段的连接

apostrophe cms data retrieval of join of pieces with join of another piece

**下面给出的代码是一个名为 home 的片段的模式字段,home 有片段与之连接,例如 _trip、_accomodation、_testimonial.These 连接的片段再次与它们的 [= 中的其他片段连接20=] 在使用 api/v1/home 检索主页时,连接件的内部连接显示为 id。

如何获取该 ID 的数据???**

 {
      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'
    },

下面给出的json是一部分数据retrived.I想要获取住宿和行程的数据是另一块,但是这里显示的是id。

"_home-spotlight": [
        {
          "_id": "cki5owqrv008obgundta0x6rp",
          "published": true,
          "trash": false,
          "type": "home-spotlight",
          "title": "spotlightAbove",
          "tripIds": [
            "cki5oqi7r0063bgun81o6umqd"
          ],
          "accommodationIds": [
            "cki5owga1008mbgunlxweuera"
          ],

目前,ApostropheCMS 无法通过 Rest API 从内部连接(即集合连接中加入了另一个集合)中获取内容。现在,我们将只获得该集合的 ID。因此,alexbea 说,我们必须进行另一个额外的 API 调用以使用 ID 获取该集合。

那些不使用 Rest API 的人可以使用 withJoins 获取这些集合 [https://docs.apostrophecms.org/reference/field-types/joinbyarray.html#settings].