GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum. Example: var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.NodeVersion.Query(). Gro
(field string, fields ...string)
| 385 | // Aggregate(ent.Count()). |
| 386 | // Scan(ctx, &v) |
| 387 | func (nvq *NodeVersionQuery) GroupBy(field string, fields ...string) *NodeVersionGroupBy { |
| 388 | nvq.ctx.Fields = append([]string{field}, fields...) |
| 389 | grbuild := &NodeVersionGroupBy{build: nvq} |
| 390 | grbuild.flds = &nvq.ctx.Fields |
| 391 | grbuild.label = nodeversion.Label |
| 392 | grbuild.scan = grbuild.Scan |
| 393 | return grbuild |
| 394 | } |
| 395 | |
| 396 | // Select allows the selection one or more fields/columns for the given query, |
| 397 | // instead of selecting all fields in the entity. |