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 { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail)
(field string, fields ...string)
| 348 | // Aggregate(ent.Count()). |
| 349 | // Scan(ctx, &v) |
| 350 | func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy { |
| 351 | _q.ctx.Fields = append([]string{field}, fields...) |
| 352 | grbuild := &UserGroupBy{build: _q} |
| 353 | grbuild.flds = &_q.ctx.Fields |
| 354 | grbuild.label = user.Label |
| 355 | grbuild.scan = grbuild.Scan |
| 356 | return grbuild |
| 357 | } |
| 358 | |
| 359 | // Select allows the selection one or more fields/columns for the given query, |
| 360 | // instead of selecting all fields in the entity. |
no outgoing calls
no test coverage detected