Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity. Example: var v []struct { Name string `json:"name,omitempty"` } client.Group.Query(). Select(group.FieldName). Scan(ctx, &v)
(fields ...string)
| 369 | // Select(group.FieldName). |
| 370 | // Scan(ctx, &v) |
| 371 | func (_q *GroupQuery) Select(fields ...string) *GroupSelect { |
| 372 | _q.ctx.Fields = append(_q.ctx.Fields, fields...) |
| 373 | sbuild := &GroupSelect{GroupQuery: _q} |
| 374 | sbuild.label = group.Label |
| 375 | sbuild.flds, sbuild.scan = &_q.ctx.Fields, sbuild.Scan |
| 376 | return sbuild |
| 377 | } |
| 378 | |
| 379 | // Aggregate returns a GroupSelect configured with the given aggregations. |
| 380 | func (_q *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect { |