neo4j - Cypher query limit results and delete -
i trying remove 20000 nodes have datestamp property = 20130808 when replace "delete nx" "return count(nx)" result 7880 , not 20000, @ moment have 1000000 nodes in neo4j 1.9.2. how can make correctly?
cypher query:
start nx=node(*) nx limit 20000 has (nx.datestamp) , nx.datestamp = 20130808 , id(nx) <> 0 delete nx
thats because first choose 20k arbitrary nodes , apply where
filter. have other way round:
start nx=node(*) has (nx.datestamp) , nx.datestamp = 20130808 , id(nx) <> 0 nx limit 20000 delete nx
be aware kind of global operation property access expensive. better approach enable autoindexing datestamp , do:
start n=node:node_auto_index(datestamp=20130808) n limit 20000 delete n
Comments
Post a Comment