neo4j/neo4j-python-driver

'Node' object has no attribute 'properties'

wjli-debug opened this issue · 1 comments

Why am I using pytho to manipulate the neo4j database schema and can't get the properties

Traceback (most recent call last):
  File "try.py", line 47, in <module>
    main()
  File "try.py", line 43, in main
    data_list = fetch_nodes_and_relations(driver)
  File "try.py", line 23, in fetch_nodes_and_relations
    'properties': record['n'].properties
AttributeError: 'Node' object has no attribute 'properties'

For support I generally refer to either of

I think the online community would be the best place for this.

I'd like to share some thoughts anyway: I'm wondering what made you believe that Node objects of the Python driver should have a properties attribute/property. If you check the API docs, you'll see that the node itself is similar to a dict. Assuming node = record["n"]andnodeactually being aNode, you can just access a given property like this node["someProperty"], or iterate over all key-property-pairs with node.items()`.