IDs executes the query and returns a list of Node IDs.
(ctx context.Context)
| 254 | |
| 255 | // IDs executes the query and returns a list of Node IDs. |
| 256 | func (nq *NodeQuery) IDs(ctx context.Context) (ids []string, err error) { |
| 257 | if nq.ctx.Unique == nil && nq.path != nil { |
| 258 | nq.Unique(true) |
| 259 | } |
| 260 | ctx = setContextOp(ctx, nq.ctx, ent.OpQueryIDs) |
| 261 | if err = nq.Select(node.FieldID).Scan(ctx, &ids); err != nil { |
| 262 | return nil, err |
| 263 | } |
| 264 | return ids, nil |
| 265 | } |
| 266 | |
| 267 | // IDsX is like IDs, but panics if an error occurs. |
| 268 | func (nq *NodeQuery) IDsX(ctx context.Context) []string { |