All Collections
Data Analysis
Gremlin training
Gremlin Training 11: Basic value access - id()
Gremlin Training 11: Basic value access - id()
Learn to use the id()-step to get the ids of components or references.
Kristine Marhilevica avatar
Written by Kristine Marhilevica
Updated over a week ago

To get the ids of a selection of components or references, the id()-step can be used.

The following query finds all the components in the organization and then returns their ids. Ids in Ardoq are unique, so there is no need to remove duplicates from the results.

g.V().id()

The following query finds the component whose id is "b9bab817a145254ce4b921ef" and then returns the id of this component. As such, the only result is the string "b9bab817a145254ce4b921ef".

g.V().hasId('b9bab817a145254ce4b921ef').id()

Did this answer your question?