Hey Volks! Is it best practise to query multiple d...
# prisma-client
m
Hey Volks! Is it best practise to query multiple data from an array of ids? As an input I got several ids which should query all data based on the ids. In Prisma you have findMany but as an input, having an array is not really best practise, is it? For Example I got an Input of an Array of ids => and in Prisma should do something like
args: [{id: "123"}, {id: "345}]
prisma.model.findMany({
where: {…}
})
d
Copy code
prisma.model.findMany({
  where: {
    OR: args
  }
})
m
@Dominic Hadfield so there is no problem to actually to give an array as an argument and get all the data from it?
d
so, the
OR
key takes an array and will return any matches for each object specified within the array. So by passing your args array, it will return any
model
with id
"123"
or
"456"
👍 1
☝️ 1
m
@Dominic Hadfield thanks a lot!