IDs executes the query and returns a list of Node IDs.
(ctx context.Context)
| 203 | |
| 204 | // IDs executes the query and returns a list of Node IDs. |
| 205 | func (nq *NodeQuery) IDs(ctx context.Context) (ids []int, err error) { |
| 206 | if nq.ctx.Unique == nil && nq.path != nil { |
| 207 | nq.Unique(true) |
| 208 | } |
| 209 | ctx = setContextOp(ctx, nq.ctx, "IDs") |
| 210 | if err = nq.Select(node.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 (nq *NodeQuery) IDsX(ctx context.Context) []int { |