From 6c4d34e91b5f41935a013a6ba03fd5d3ed9b463f Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Sun, 14 Mar 2021 16:29:02 +0200 Subject: [PATCH] doc/crud: field selection for update --- doc/md/crud.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/md/crud.md b/doc/md/crud.md index f22f42a35..8911fdb3c 100755 --- a/doc/md/crud.md +++ b/doc/md/crud.md @@ -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.