Step 1: Understand filtering related records in include
To filter related posts, use include with posts and a where clause inside it.
Step 2: Analyze options
prisma.user.findMany({ include: { posts: { where: { createdAt: { gt: new Date('2023-01-01') } } } } }) correctly places where inside posts in include to filter posts by createdAt.
Final Answer:
prisma.user.findMany with include posts filtered by where -> Option C
Quick Check:
Filter related records inside include with where [OK]
Quick Trick:Filter related records inside include using where clause [OK]
Common Mistakes:
Placing where outside include
Omitting where clause inside posts
Using invalid syntax for filtering
Master "Database with Prisma" in NestJS
9 interactive learning modes - each teaches the same concept differently