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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Metadata.Query(). Select(metadata.FieldCreatedAt). Scan(ctx, &v)
(fields ...string)
| 327 | // Select(metadata.FieldCreatedAt). |
| 328 | // Scan(ctx, &v) |
| 329 | func (mq *MetadataQuery) Select(fields ...string) *MetadataSelect { |
| 330 | mq.ctx.Fields = append(mq.ctx.Fields, fields...) |
| 331 | sbuild := &MetadataSelect{MetadataQuery: mq} |
| 332 | sbuild.label = metadata.Label |
| 333 | sbuild.flds, sbuild.scan = &mq.ctx.Fields, sbuild.Scan |
| 334 | return sbuild |
| 335 | } |
| 336 | |
| 337 | // Aggregate returns a MetadataSelect configured with the given aggregations. |
| 338 | func (mq *MetadataQuery) Aggregate(fns ...AggregateFunc) *MetadataSelect { |