Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit d28cc75

Browse files
committed
add docs for set
1 parent c7effac commit d28cc75

3 files changed

Lines changed: 19 additions & 17 deletions

File tree

docs/1.25/prisma-client/basic-data-access/writing-data-JAVASCRIPT-rsc6.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,15 @@ The [MongoDB](jgfm) database connector currently does not support ACID transacti
576576

577577
</Warning>
578578

579-
If a model has a relation to a different model, the corresponding relation field is set with an object that has a subset of the following properties:
580-
581-
- `create`: Creates a new record of the related model and connects it via the relation.
582-
- `update`: Updates an existing record of the related model that is already connected via the relation.
583-
- `upsert`: Updates an existing record of the related model or creates and connects a new one.
584-
- `delete`: Deletes an existing record of the related model that is connected via the relation.
585-
- `connect`: Connects an existing record of the related model via the relation.
586-
- `disconnect`: Deletes an existing record of the related model via the relation.
579+
If a model `A` has a relation to a different model `B`, you can write to the model `B` through `createA` and `updateA` operations. In these cases, the `data` argument for the `createA` and `updateA` operations can contain one of the following keywords:
580+
581+
- `create`: Creates a new model `B` and connects it via a relation field to the model `A`.
582+
- `update`: Updates an existing model `B` that is connected to the model `A` via a relation field.
583+
- `upsert`: Updates an existing model `B` that is connected to the model `A` via a relation field or creates a new model `B` and connects it via a relation field to the model `A`.
584+
- `delete`: Deletes an existing model `B` that is connected to the model `A` via a relation field.
585+
- `connect`: Connects an existing model `B` to an the model `A` via a relation field.
586+
- `disconnect`: Disconnects an existing model `B` from the relation to model `A`.
587+
- `set`: Connects an existing model `B` to an the model `A` via a relation field. If the model `B` was connected to a different model `A` before, it is further disconnected from that (the connection is "rewired").
587588

588589
### Examples
589590

docs/1.25/prisma-client/basic-data-access/writing-data-TYPESCRIPT-rsc7.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,15 @@ The [MongoDB](jgfm) database connector currently does not support ACID transacti
576576

577577
</Warning>
578578

579-
If a model has a relation to a different model, the corresponding relation field is set with an object that has a subset of the following properties:
580-
581-
- `create`: Creates a new record of the related model and connects it via the relation.
582-
- `update`: Updates an existing record of the related model that is already connected via the relation.
583-
- `upsert`: Updates an existing record of the related model or creates and connects a new one.
584-
- `delete`: Deletes an existing record of the related model that is connected via the relation.
585-
- `connect`: Connects an existing record of the related model via the relation.
586-
- `disconnect`: Deletes an existing record of the related model via the relation.
579+
If a model `A` has a relation to a different model `B`, you can write to the model `B` through `createA` and `updateA` operations. In these cases, the `data` argument for the `createA` and `updateA` operations can contain one of the following keywords:
580+
581+
- `create`: Creates a new model `B` and connects it via a relation field to the model `A`.
582+
- `update`: Updates an existing model `B` that is connected to the model `A` via a relation field.
583+
- `upsert`: Updates an existing model `B` that is connected to the model `A` via a relation field or creates a new model `B` and connects it via a relation field to the model `A`.
584+
- `delete`: Deletes an existing model `B` that is connected to the model `A` via a relation field.
585+
- `connect`: Connects an existing model `B` to an the model `A` via a relation field.
586+
- `disconnect`: Disconnects an existing model `B` from the relation to model `A`.
587+
- `set`: Connects an existing model `B` to an the model `A` via a relation field. If the model `B` was connected to a different model `A` before, it is further disconnected from that (the connection is "rewired").
587588

588589
### Examples
589590

docs/1.25/prisma-graphql-api/reference/mutations-qwe2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ mutation {
212212
name
213213
email
214214
}
215-
}
215+
}`
216216
```
217217

218218
## Nested mutations

0 commit comments

Comments
 (0)