Skip to main content
Version: 3.1.0

descendants Command

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

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

Usage​

descendants [--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 traverse❌delete

Examples​

Equivalent to query is(aws_region) -[1:]->
> search is(aws_region) | descendants
Equivalent to query is(aws_region) -[0:]->
> search is(aws_region) | descendants --with-origin
> search is(volume_type) limit 1 | descendants --with-origin
​kind=gcp_disk_type, name=pd-standard, age=52yr1mo, cloud=gcp, account=sre, region=us-central1, zone=us-central1-a
​kind=gcp_disk, id=881, name=disk-1, age=1yr2mo, cloud=gcp, account=sre, region=us-central1, zone=us-central1-a