findMany - query table for all values not in another
hey, just trying to sort out a minor problem with a program of mine
i'm trying to query a table,
Track
, and only return the records from the table if TrackID
is not in another table, TrackToPlaylist
in postgres, syntax for this would be similar to the following:
however, i'm a little stumped on how to go about implementing this in prisma, i've tried querying the entirety of TrackToPlaylist
then filtering to create a list of TrackID
's & using it in a not query, but i occasionally run into the following error when there's a lot of tracks
1 Reply
for reference here's my schema
forgive me, found an answer to my own question :P
the solution was using this in the
where
clause within my findMany
call