Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-16-2022 09:39 AM
type(i).__name__: Node
type(i).__name__: dict
Solved! Go to Solution.
08-18-2022 04:13 AM - edited 08-22-2022 08:24 AM
This is a shot in the dark, but maybe you are using Result.data()
(https://neo4j.com/docs/api/python-driver/4.4/api.html#neo4j.Result.data). Generally, I'd not recommend to use it for anything but prototyping and debugging. It has its limitations and is more the type of API to get you started quickly but less so to give you full control of what's going on under the hood.
08-18-2022 04:08 AM
Can you share a little more of your code, please?
Where exactly does i
come from? I wasn't able to reproduce what you describe.
Here is a code snipped run on the 4.4 branch of the Python driver (dev snapshot, but should be the same for all of at least 4.4):
with neo4j.GraphDatabase.driver(uri, auth=auth) as driver:
with driver.session(database="neo4j") as session:
result = session.run("MERGE (n:Foo {bar: 'baz'}) RETURN n")
record = result.single()
node = record["n"]
print(type(node))
Which prints <class 'neo4j.graph.Node'>
.
08-18-2022 04:13 AM - edited 08-22-2022 08:24 AM
This is a shot in the dark, but maybe you are using Result.data()
(https://neo4j.com/docs/api/python-driver/4.4/api.html#neo4j.Result.data). Generally, I'd not recommend to use it for anything but prototyping and debugging. It has its limitations and is more the type of API to get you started quickly but less so to give you full control of what's going on under the hood.
08-18-2022 11:43 AM
aha, yes, we're doing exactly what you guessed: result.data()
We'll switch to result.single() or similar and see how that works out.
All the sessions of the conference are now available online