The query of g.V().hasId("customid") does return the vertex, but we are not able to get the properties of the vertex. What is the way to get the vertex with all the properties associated with it..
Traditionally you would use the valueMap step to get the properties and optionally the id and label of the vertex.
will return all of the properties of that vertex.
will also return the ID and the label.
In recent versions of TinkerPop (and DS Graph), there is a cleaner alternative to valueMap called elementMap.
and this is essentially equivalent to
As a recommendation, I would always specify the vertex label with DataStax Graph because it allows the engine to know what vertex/table to start in. So I would do something like:
or more succinctly
g.V().has('order', 'orderid', 1001).elementMap();
7 People are following this question.