The question title pretty much sums up the issue. I have 20 videos saved in a database, and I want every newly created user to be connected to all of these videos, so that every user can access every video. The issue is, I don't know how to grab all of them, and I'm not even sure how I would do some work around using findMany
. Would something like the code below work?
prisma.video.findMany({
where: {
id
}
})
My thought there is that if every video object has an id this should work. Currently it isn't, and I'm not sure if this is the syntax to blame.
This will give you videos
prisma.video.findMany()
The syntax you used
where: {
id
}
is a shorthand for
where: {
id: id
}
and it will give you a list of all videos that have id equal to whatever you have in id variable. If id is a unique identifier, this list will contain at maximum one video.