is it possible to do nested connectOrCreate? for e...
# prisma-client
r
is it possible to do nested connectOrCreate? for example
Copy code
const album = {
        ...result,
        songs: {
          connectOrCreate: result.songs.map(s => ({
            create: {
                ...s,
                artists: {
                    connectOrCreate: s.artists.map(a => ({
                    create: a,
                    where: { spotify_id: a.spotify_id }
                }))
            },
            where: { spotify_id: s.spotify_id }
          }))
        }
      }

schema:
model Album {
   artists					Artist[]
   songs					Song[]
}

model Artist {
    albums    				Album[]
	songs					Song[]
}

model Song {
   album    				Album    	@relation(fields: [album_spotify_id], references: [spotify_id], onDelete: Cascade)
	artists					Artist[]
}
r
@Ridhwaan Shakeel 👋 Yes it should be possible. Are you facing an error?