#[SOLVED] Relationships IDs

13 messages · Page 1 of 1 (latest)

astral grail
#

I have two questions with relationships.

  1. How can I define an ID in the relationed item being added.
    .createDocument("645c032960cb9f95212b", "album", track.album.id, {
      name: track.album.name,
      href: track.album.external_urls.spotify,
      popularity: track.album.popularity,
      images: track.album.images?.map((image) => image.url) ?? [],
      artist: [{
          name: track.artists[i].name,
          href: track.artists[i].external_urls.spotify,
          popularity: track.artists[i].popularity,
          images: track.artists[i].images?.map((image) => image.url) ?? [],
          genres: track.artists[i].genres ?? [],
      }],
      track: [{
          name: track.name,
          href: track.external_urls.spotify,
          popularity: track.popularity,
          preview: track.preview_url,
          explicit: track.explicit,
          duration: track.duration_ms,
      }],
    })

With this code above how can I explicitly set the ID for Artist and Track.

  1. How can I relate a new item to an existing item?
prime bane
astral grail
#

Yea, but in another query at a later time I want to then relate a new item with an existing track.

prime bane
bleak swift
bleak swift
bleak swift
prime bane
bleak swift
stuck finch
#

Can I close this if resolved @prime bane @astral grail

prime bane
astral grail
#

Thanks everyone! This got me what I needed.