[Python] Neo4j python driver results don't contain edge data

Discussão em 'Python' iniciado por Stack, Abril 15, 2025.

  1. Stack

    Stack Membro Participativo

    This is my Cypher query and its equivalent result in neo4j Browser


    MATCH (a)-[b:REFERENCE]->(c) RETURN a,b,c LIMIT 200
    ​

    [​IMG]

    The b column (or key in JSON) contains the relationship and all the data that is associated with it. This is my ideal response.

    However running the same query in my Python API using the neo4j driver(==5.7.0) gives me the following result

    [​IMG]

    The 'b' column now gives me redundant and incomplete information

    Following is a snippet of the API code

    with self.driver.session() as session:
    return [record.data() for record in session.run(query)]


    What I tried:

    1. Using different methods for Record object as seen here
    2. Using different methods for Response object as seen here
    3. Changing query to

      MATCH p = ()-[:REFERENCE]->() RETURN p LIMIT 200
      ​

    None of this yielded different results

    Continue reading...

Compartilhe esta Página