Skip to content

Commit

Permalink
Update 050-prisma-client-reference.mdx (#6462)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-arch authored Nov 27, 2024
1 parent 64f33cf commit 9f97985
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/200-orm/500-reference/050-prisma-client-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -627,16 +627,15 @@ 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 <Model> 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 <Model> found`. Here’s an example of its usage:

```ts
await prisma.user.findUniqueOrThrow({
where: {
id: 1,
},
});
```

`findUniqueOrThrow` differs from `findUnique()` as follows:

Expand Down

0 comments on commit 9f97985

Please sign in to comment.