Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 050-prisma-client-reference.mdx #6457

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions content/200-orm/500-reference/050-prisma-client-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -651,19 +651,20 @@ We introduced `findUniqueOrThrow` in v4.0.0. It replaces the [`rejectOnNotFound`

#### Options

| Name | Example type (`User`) | Required | Description |
| ------------------------------- | ------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| `select` | `XOR<UserSelect, null>` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| `include` | `XOR<UserInclude, null>` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| `omit` | `XOR<UserOmit, null>` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0. |
| `relationLoadStrategy` | `'join'` or `'query'` | No | **Default: `join`**. Specifies the [load strategy](/orm/prisma-client/queries/relation-queries#relation-load-strategies-preview) for a relation query. Only available in combination with `include` (or `select` on a relation field). In [Preview](/orm/more/releases#preview) since 5.9.0. |
| `where` | `UserWhereInput` | No | Wraps _all_ model fields in a type so that the list can be filtered by any property. |
| `orderBy` | `XOR<Enumerable<User`<br />`OrderByInput>,UserOrderByInput>` | No | Lets you order the returned list by any property. |
| `cursor` | `UserWhereUniqueInput` | No | Specifies the position for the list (the value typically specifies an `id` or another unique value). |
| `take` | `number` | No | Specifies how many objects should be returned in the list. When used with `findFirst`, `take` is implicitly `1` or `-1`. `findFirst` is only affected by whether the value is positive or negative - any negative value reverses the list. |
| `skip` | `number` | No | Specifies how many of the returned objects in the list should be skipped. |
| `distinct` | `Enumerable<UserDistinct`<br />`FieldEnum>` | No | Lets you filter out duplicate rows by a specific field - for example, return only distinct `Post` titles. |
| `rejectOnNotFound` (deprecated) | `RejectOnNotFound` | No | If true, throw a `NotFoundError: No User found error`. You can also [configure `rejectOnNotFound` globally](#rejectonnotfound). <br></br>**Note:** `rejectOnNotFound`is deprecated in v4.0.0. From v4.0.0, use [`findFirstOrThrow`](#findfirstorthrow) instead. | |
| Name | Example type (`User`) | Required | Description |
| ------------------------------- | ----------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `select` | `XOR<UserSelect, null>` | No | [Specifies which properties to include](/orm/prisma-client/queries/select-fields) on the returned object. |
| `include` | `XOR<UserInclude, null>` | No | [Specifies which relations should be eagerly loaded](/orm/prisma-client/queries/relation-queries) on the returned object. |
| `omit` | `XOR<UserOmit, null>` | No | Specifies which properties to exclude on the returned object. In [Preview](/orm/more/releases#preview) since 5.13.0. |
| `relationLoadStrategy` | `'join'` or `'query'` | No | **Default: `join`**. Specifies the [load strategy](/orm/prisma-client/queries/relation-queries#relation-load-strategies-preview) for a relation query. Only available in combination with `include` (or `select` on a relation field). In [Preview](/orm/more/releases#preview) since 5.9.0. |
| `where` | `UserWhereInput` | No | Wraps _all_ model fields in a type so that the list can be filtered by any property. |
| `orderBy` | `XOR<Enumerable<UserOrderByInput>, UserOrderByInput>` | No | Lets you order the returned list by any property. |
| `cursor` | `UserWhereUniqueInput` | No | Specifies the position for the list (the value typically specifies an `id` or another unique value). |
| `take` | `number` | No | Specifies how many objects should be returned in the list. When used with `findFirst`, `take` is implicitly `1` or `-1`. `findFirst` is only affected by whether the value is positive or negative - any negative value reverses the list. |
| `skip` | `number` | No | Specifies how many of the returned objects in the list should be skipped. |
| `distinct` | `Enumerable<UserDistinctFieldEnum>` | No | Lets you filter out duplicate rows by a specific field - for example, return only distinct `Post` titles. |
| `rejectOnNotFound` (deprecated) | `RejectOnNotFound` | No | If true, throw a `NotFoundError: No User found error`. You can also [configure `rejectOnNotFound` globally](#rejectonnotfound). <br></br>**Note:** `rejectOnNotFound` is deprecated in v4.0.0. From v4.0.0, use [`findFirstOrThrow`](#findfirstorthrow) instead. |


#### Return type

Expand Down
Loading