'Is there a way to set up MongoDB ttl indexes using prisma

I am trying to make a Hotel website backend that allows users to reserve rooms using GraphQL and prisma. I want to make sure that the reservation will be cancelled after the check-in time if no one has checked in. To do this I wanted to set up a ttl index that will delete the reservation.

If there is any alternative way of doing this you can help me.



Solution 1:[1]

take a look on this : https://www.prisma.io/docs/concepts/components/prisma-schema/indexes

model Post {
  id      Int    @id
  title   String @db.VarChar(255)
  content String @db.Text

  @@fulltext([title, content])
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney