IDs executes the query and returns a list of Meta IDs.
(ctx context.Context)
| 203 | |
| 204 | // IDs executes the query and returns a list of Meta IDs. |
| 205 | func (_q *MetaQuery) IDs(ctx context.Context) (ids []int, err error) { |
| 206 | if _q.ctx.Unique == nil && _q.path != nil { |
| 207 | _q.Unique(true) |
| 208 | } |
| 209 | ctx = setContextOp(ctx, _q.ctx, ent.OpQueryIDs) |
| 210 | if err = _q.Select(meta.FieldID).Scan(ctx, &ids); err != nil { |
| 211 | return nil, err |
| 212 | } |
| 213 | return ids, nil |
| 214 | } |
| 215 | |
| 216 | // IDsX is like IDs, but panics if an error occurs. |
| 217 | func (_q *MetaQuery) IDsX(ctx context.Context) []int { |