diff --git a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx index b7a14af3ec..4f8e533a55 100644 --- a/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx +++ b/content/200-orm/200-prisma-client/100-queries/037-relation-queries.mdx @@ -726,14 +726,14 @@ const categories = await prisma.category.createManyAndReturn({ const posts = await prisma.post.createManyAndReturn({ data: [{ title: "Funniest moments in 2024", - categoryId: categories[0].id + categoryId: categories.filter(category => category.name === 'Fun')!.id }, { title: "Linux or macOS — what's better?", - categoryId: categories[1].id + categoryId: categories.filter(category => category.name === 'Technology')!.id }, { title: "Who will win the next soccer championship?", - categoryId: categories[2].id + categoryId: categories.filter(category => category.name === 'Sports')!.id }] }); ``` diff --git a/content/200-orm/500-reference/050-prisma-client-reference.mdx b/content/200-orm/500-reference/050-prisma-client-reference.mdx index ca62e82ef3..20b3c81037 100644 --- a/content/200-orm/500-reference/050-prisma-client-reference.mdx +++ b/content/200-orm/500-reference/050-prisma-client-reference.mdx @@ -1274,6 +1274,7 @@ This feature is available in Prisma ORM version 5.14.0 and later for PostgreSQL, #### Remarks - The `skipDuplicates` option is not supported by SQLite. +- Note that the order of elements returned by `createManyAndReturn` is not guaranteed. - You **cannot** create or connect relations by using nested `create`, `createMany`, `connect`, `connectOrCreate` queries inside a top-level `createManyAndReturn()` query. See here for a [workaround](/orm/prisma-client/queries/relation-queries#using-nested-createmany). - When relations are included via `include`, a separate query is generated per relation. - `relationLoadStrategy: join` is not supported.