testas
PPrisma
•Created by testas on 6/6/2024 in #help-and-questions
Help Needed with Nested CreateMany!
Hi everyone,
I’m currently working on an API route to handle a POST request that does the following:
1. Accepts a single classroomId.
2. Retrieves all students in the classroom via memberships.
3. Creates an AssignmentSet for the classroom.
4. Iterates over the students to:
• Create an Assignment for each student.
• Create a Portfolio for each student.
• Connect the Assignment to the AssignmentSet.
I’m encountering issues with Prisma’s lack of support for nested CreateMany. Could anyone provide guidance or workarounds to achieve this functionality?
Creating the records one by one is too slow when there are potentially hundreds of students to iterate over.
Thanks for any suggestion/help!
10 replies