From 9f97985be3ae62058751732cf982ddfd08ee5867 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:07:13 +0600 Subject: [PATCH] Update 050-prisma-client-reference.mdx (#6462) --- .../200-orm/500-reference/050-prisma-client-reference.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 d02bc906df..88298524c0 100644 --- a/content/200-orm/500-reference/050-prisma-client-reference.mdx +++ b/content/200-orm/500-reference/050-prisma-client-reference.mdx @@ -627,9 +627,7 @@ We introduced `findUniqueOrThrow` in v4.0.0. It replaces the [`rejectOnNotFound` ::: -`findUniqueOrThrow` retrieves a single data record similarly to [`findUnique()`](#findunique). However, if no record is found, it throws a `NotFoundError` with a message like: `No found`. - -Here’s an example of how it works: +`findUniqueOrThrow` retrieves a single data record similarly to [`findUnique()`](#findunique). However, if no record is found, it throws a `NotFoundError` with a message like: `No found`. Here’s an example of its usage: ```ts await prisma.user.findUniqueOrThrow({ @@ -637,6 +635,7 @@ await prisma.user.findUniqueOrThrow({ id: 1, }, }); +``` `findUniqueOrThrow` differs from `findUnique()` as follows: