Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-11-2021 05:44 AM
Hi,
I am back after 2 years. I was using neo4j driver successfully before, but now it does not return any data. Not sure if there is any changes for this: (I am now using latest neo4j official driver)
with driver.session() as session:
result = session.run("MATCH(n) RETURN n")
print(result.data(), result.single())
[{'n': {}}] None
I have hard research for this and found nothing helpful.
Solved! Go to Solution.
04-12-2021 06:54 AM
Finally, I got it working after trying with very new simple python application. What I was doing wrong that printed result in with
statement. Rather I have to separate run
syntax outside of with session
syntax. And printing value there works perfectly.
04-11-2021 11:25 PM
It's working as intended. There is one node that contains no attributes: [{'n': {}}]
. Note that after consuming a result, it's empty—like an iterator. So after calling result.data()
or doing result_list = list(result)
, result.single()
or repeating one of the above instructions will not give you the same data again. That's why result.single()
returns None
in your example.
04-11-2021 11:29 PM
Even if I just only use result.single()
, it doesn't return the data. And the data() should result more nodes. There's something wrong I can't get the expected result.
After debugging, I got <neo4j.work.result.Result
object, as far as I remember it should return <Node.
object. I don't know what's going on.
04-12-2021 06:54 AM
Finally, I got it working after trying with very new simple python application. What I was doing wrong that printed result in with
statement. Rather I have to separate run
syntax outside of with session
syntax. And printing value there works perfectly.
09-05-2021 11:07 PM
How does the run work outside the session context? Can you share your sample code?
i have a similar problem where i get result with 4.2 driver but not with 4.3.3 version. Its strange.
All the sessions of the conference are now available online