Skip to main content

predecessors Command

The predecessors command selects all predecessors of nodes returned in a query.

Usage

predecessors [--with-origin] <edge_type>

Parameters

ParameterDescriptionRequired?Default Value
edge_typeEdge type by which to traversedelete

Options

OptionDescriptionRequired?
--with-originInclude current element in the result set

Examples

Equivalent to query is(aws_region) <--
> search is(aws_region) | predecessors
Equivalent to query is(aws_region) <-[0:1]-
> search is(aws_region) | predecessors --with-origin
> search is(volume) and volume_status=available | predecessors | query is(volume_type)
​kind=gcp_disk_type, name=pd-standard, age=2yr1mo, cloud=gcp, account=eng, region=us-central1, zone=us-central1-a
​kind=gcp_disk_type, name=pd-standard, age=2yr1mo, cloud=gcp, account=sre, region=us-central1, zone=us-central1-a
​kind=aws_ec2_volume_type, name=gp2, age=5d8h, cloud=aws, account=sales, region=us-west-2

Further Reading