title: How can I filter by a value inside a pivot table (using Prisma)?
body: <p>I'm building a bike rental app where users can reserve bikes for a certain number of days. Bikes and users have a many-to-many relationship, there's a bike_user pivot table that contains the information about reservation start and end dates. See the diagram:
  <img src="https://user-images.githubusercontent.com/4761235/167254623-e74cc0ce-7cd7-4487-a0a0-a3ef499b6c41.png" alt="bikerr" /></p>
  <p>My schema looks kinda like this:</p>
  <pre><code>model User {
    id            String @id @default(cuid())
    username      String @unique
    email         String @unique
    rented_bikes  BikeUser[]
  }
  
  
  model Bike {
    id              String @id @default(cuid())
    model           String
    color           String
    rented_by_users BikeUser[]
  }
  
  model BikeUser {
    user                      User @relation(fields: [userId], references: [id])
    userId                    String
    bike                      Bike @relation(fields: [bikeId], references: [id])
    bikeId                    String
    reservation_start_date    DateTime 
    reservation_end_date      String
  
    @@id([userId, bikeId])
  }
  </code></pre>
  <p>My goal is to take a range of dates, and filter the bikes, showing only the ones that haven't been reserved between these two dates.</p>
  <p>Can you please help me figure out how to do this?</p>