Question

Using the py2neo tutorial (http://book.py2neo.org/en/latest/cypher/):

    from py2neo import neo4j, cypher
    graph_db = neo4j.GraphDatabaseService()
    query = "START a=node(1) RETURN a"
    data, metadata = cypher.execute(graph_db, query)
    a = data[0][0]  # first row, first column

Trying to replicate this, I get:

>data[0][0]

Node('http://localhost:7474/db/data/node/1')

How do I get this to return the actual data, instead of the abstract information?

Was it helpful?

Solution

Your Cypher query returns a node (RETURN a) and so that's what's being passed back: a Node object. If it's the node's properties that you need, you can either then inspect the properties on that node with the get_properties method or return specific properties from the Cypher query instead (RETURN a.name).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top