title: Find many rows in Prisma ORM basing on random numbers
body: <p><strong>Prisma2 ORM</strong></p>
  <p>Hello, is there any way I cant make it shorter? It looks really bad.. I've tried with loops, but it was breaking.</p>
  <p>Generating random indexes of cards</p>
  <pre><code>export const getRandomCards = (cards: any) =&gt; {
    let randomCards: number[] = [];
    while (randomCards.length &lt; 5) {
      let card = Math.floor(Math.random() * cards.length);
      if (!randomCards.includes(card)) randomCards.push(card);
    }
    return randomCards;
  };
  </code></pre>
  <p>Then I want to send cards basing on previously generated indexes from the array.</p>
  <pre><code>import express, { Request, Response, NextFunction } from &quot;express&quot;;
  
  import { getRandomCards } from &quot;./../../../util&quot;;
  
  import prisma from &quot;../../../client&quot;;
  
  export const getEvents = async (
    _req: Request,
    res: Response,
    next: NextFunction
  ) =&gt; {
    const cards = await prisma.event.findMany();
  
    if (!cards) throw new Error();
  
    const randomCards = getRandomCards(cards);
  
    try {
      const firstCard = await prisma.event.findUnique({
        where: {
          id: randomCards[0],
        },
      });
      const secondCard = await prisma.event.findUnique({
        where: {
          id: randomCards[1],
        },
      });
      const thirdCard = await prisma.event.findUnique({
        where: {
          id: randomCards[2],
        },
      });
      const fourthCard = await prisma.event.findUnique({
        where: {
          id: randomCards[3],
        },
      });
      const fifthCard = await prisma.event.findUnique({
        where: {
          id: randomCards[4],
        },
      });
  
      res.send({
        cards: { firstCard, secondCard, thirdCard, fourthCard, fifthCard },
      });
    } catch (err) {
      throw new Error(err);
    }
  
    next();
  };
  </code></pre>
  <p>Is doing it like that even a correct approach?</p>