doc/crud: field selection for update

This commit is contained in:
Ariel Mashraki
2021-03-14 16:29:02 +02:00
committed by Ariel Mashraki
parent 5d70144f44
commit 6c4d34e91b

View File

@@ -262,6 +262,19 @@ if err != nil {
}
```
Update an entity and return a partial of it.
```go
pedro, err := client.Pet.
UpdateOneID(id).
SetAge(9).
SetName("pedro").
// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
Select(pet.FieldName).
Save(ctx)
```
## Delete One
Delete an entity.