1

I was trying to reach the janusgraph deployed inside the GKE cluster, using the below code.

from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.anonymous_traversal import traversal

g = traversal().withRemote(DriverRemoteConnection('gs://private_network:8182/janusgraph','g'))
count = g.V().has('name','hercules').valueMap()
print(count)
Archie
  • 71
  • 8

1 Answers1

2

when using Python you need to end the call with a "terminal" step. These steps include next, toList and iterate.

In this case as you are returning a single result (a valueMap) using next is sufficient.

Side note - the example code is a little confusing as the code is not returning a "count". Anyway, please try:

count = g.V().has('name','hercules').valueMap().next()
Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38