Skip to main content
Version: 3.1.0

predecessors Command

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

Please refer to the Search Traversals for a detailed explanation of traversals.

Usage

predecessors [--with-origin] <edge_type>

Options

OptionDescription
--with-originIncludes the current element in the result set.

Parameters

ParameterDescriptionRequired?Default Value
edge_typeEdge type by which to traversedelete

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