β11-30-2021 09:05 AM
CALL apoc.periodic.iterate(
"MATCH (n:Article) return n.nid",
"REMOVE n.bertEmbedding",
{batchSize:30000, parallel:false, iterateList:true})
The error message:
org.neo4j.graphdb.QueryExecutionException: Variable
n not defined (line 1, column 65 (offset: 64))\n"UNWIND $_batch AS _batch WITH _batch.
n.nidAS
n.nid REMOVE n.bertEmbedding"\n ^": 1
According to the documentation, the following example query is valid (apoc.periodic.iterate - APOC Documentationπ
CALL apoc.periodic.iterate(
"MATCH (p:Person) WHERE (p)-[:ACTED_IN]->() RETURN p",
"SET p:Actor",
{batchSize:10000, parallel:true})
Solved! Go to Solution.
β11-30-2021 11:33 AM
This is invalid because you are returning n.nid instead of n in the first part of query.
Your correct query should be:
ALL apoc.periodic.iterate(
"MATCH (n:Article) return n",
"REMOVE n.bertEmbedding",
{batchSize:30000, parallel:false, iterateList:true})
β11-30-2021 11:33 AM
This is invalid because you are returning n.nid instead of n in the first part of query.
Your correct query should be:
ALL apoc.periodic.iterate(
"MATCH (n:Article) return n",
"REMOVE n.bertEmbedding",
{batchSize:30000, parallel:false, iterateList:true})
β11-30-2021 01:13 PM
That's true. I misunderstood the 'return' statement in this context, which must return the whole thing in order for the 2nd statement to work properly.