Nathaniel Babalola
08/10/2021, 11:57 AMconst id = req.user.id;
const myBookings = await prisma.traveller.findMany({
where: {
userId: id
},
select: {
flightBooking: true
}
});
Hi pls I have this query, but there are multiple travellers
that may have the same flightBooking
, so it would return the same flightBooking
details multiple times if different travellers have it.
Is there a way I can optimize this query to return just one instance of flightBooking
or not duplicate it if it has already returned it?Ryan
08/10/2021, 11:59 AMNathaniel Babalola
08/10/2021, 12:03 PM