cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4j python driver seems unable to process more than 1 node in a query

I'm trying to run a cypher query from a python script.
The part of the function that does it looks like this:

with driver.session() as session:
		result = session.run("match (place:{})\
							  where place.name = \"{}\"\
							  return (place)"
							 .format(joined_labels, name))
		print ("result = {}".format(result))
		for r in result:
			print ("r={}".format(r))

It runs fine and returns a neo4j.BoltStatementResult object that I can iterate over (there is only one r in that result, and it's a Node).

The actual query I wish to run is this:

with driver.session() as session:
		result = session.run("match (arch:Person:Architect)-[b:BUILT]->(place:{})\
							  where place.name = \"{}\"\
							  return (arch), (place)"
							 .format(joined_labels, name))
		print ("result = {}".format(result))
		for r in result:
			print ("r={}".format(r))

It returns a neo4j.BoltStatementResult object as well, but I seemingly can't iterate over it.
Meanwhile, both of these queries run fine in Neo4j browser.

The script is run on Ubuntu 18.04, with python 3.7.5, neo4j 4.0.4, and neo4j driver 1.7.6.

Why might this be happening?

1 REPLY 1

Oh, my goodnes. It was all due to a typo. I'm so sorry. Please close this question or something.