Rene Nielsen
02/14/2022, 8:29 PMmodel Course {
  topic           Topic           @relation("Topic", fields: [topicId], references: [id])
  topicId         String          @db.ObjectId
  subTopic        Topic           @relation("SubTopic", fields: [subTopicId], references: [id])
  subTopicId      String          @db.ObjectId
}
model Topic {
  courses.        Course[] ????
}Nurul
02/15/2022, 6:56 AMmodel Course {
  id         String @id
  topic      Topic  @relation("Topic", fields: [topicId], references: [id])
  topicId    String
  subTopic   Topic  @relation("SubTopic", fields: [subTopicId], references: [id])
  subTopicId String
}
model Topic {
  id             String   @id
  name           String
  CourseTopic    Course[] @relation("Topic")
  CourseSubTopic Course[] @relation("SubTopic")
}
Please let me know in case you face any issues.
Here is the guide for implementing relations in case you want to have a look.Rene Nielsen
02/15/2022, 12:08 PM