cat
cat
PPrisma
Created by cat on 9/19/2024 in #help-and-questions
findMany - query table for all values not in another
forgive me, found an answer to my own question :P the solution was using this in the where clause within my findMany call
TrackToPlaylist: {
none: {}
}
TrackToPlaylist: {
none: {}
}
3 replies
PPrisma
Created by cat on 9/19/2024 in #help-and-questions
findMany - query table for all values not in another
for reference here's my schema
model Track {
TrackID Int @id @unique
Title String
Description String
TrackURL String
CreatedAt DateTime

TrackAuthor Author @relation(fields: [AuthorID], references: [AuthorID])
AuthorID Int

TrackToPlaylist TrackToPlaylist[]
}

...

model TrackToPlaylist {
TrackID Int
PlaylistID Int

Track Track @relation(fields: [TrackID], references: [TrackID])
Playlist Playlist @relation(fields: [PlaylistID], references: [PlaylistID])

@@id([TrackID, PlaylistID])
}
model Track {
TrackID Int @id @unique
Title String
Description String
TrackURL String
CreatedAt DateTime

TrackAuthor Author @relation(fields: [AuthorID], references: [AuthorID])
AuthorID Int

TrackToPlaylist TrackToPlaylist[]
}

...

model TrackToPlaylist {
TrackID Int
PlaylistID Int

Track Track @relation(fields: [TrackID], references: [TrackID])
Playlist Playlist @relation(fields: [PlaylistID], references: [PlaylistID])

@@id([TrackID, PlaylistID])
}
3 replies