Cypher queries as batch operations on Neo4j

2019-04-09 04:01发布

问题:

I need to run this type of queries in PHP:

START n = node($thisUser), m = node($userId)
MATCH n-[r:RATED]->m
WHERE r.skillId = $id
RETURN id(r)

There are a lot of them for a single page (~30). Since it's using REST, the run-time comes out not applicable (~5-10 seconds). So I'm trying to send them in a single batch but I cannot find any method to send actual cypher queries through REST as operations in a single batch.

Is there a way to do it?

回答1:

Have you tried the following?

a) the transactional rest resource
b) batching multiple calls to the /db/data/cypher resource via the /db/data/batch resource, with "to":"/cypher" in the payload
c) passing collections instead of single values as parameters