``` const id = req.user.id;         const m...
# orm-help
n
Copy code
const 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?
r
I don’t think so. It will query for the relations for each record.
n
hmmm, thought as much @Ryan, thanks
👍 1