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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Node.Query(). GroupBy(node
(field string, fields ...string)
| 307 | // Aggregate(ent.Count()). |
| 308 | // Scan(ctx, &v) |
| 309 | func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy { |
| 310 | nq.ctx.Fields = append([]string{field}, fields...) |
| 311 | grbuild := &NodeGroupBy{build: nq} |
| 312 | grbuild.flds = &nq.ctx.Fields |
| 313 | grbuild.label = node.Label |
| 314 | grbuild.scan = grbuild.Scan |
| 315 | return grbuild |
| 316 | } |
| 317 | |
| 318 | // Select allows the selection one or more fields/columns for the given query, |
| 319 | // instead of selecting all fields in the entity. |
no outgoing calls
no test coverage detected