Search code examples
neo4jcypherrange-query

how to extract neo4j data with range query


I am new to neo4j.I need to extract first 5 million or any range of 5 million data with relationship from this 20 millions dataset.I have been struggling to run range query on my data. If I can extract the data and again import to neo4j it would be great luck for me.

these are the properties of my node - address,hash,time,nounce,public_key(all node doesn't contain same properties, some contain address, some hash,time etc)

just to let you know. if I do start n=node(*) return n; then looks like my computer goes to never ending sleep.

any help would be trully appreciated.


Solution

  • So you want it to return the any 5 million nodes? That's going to be a lot of data. The reason your computer keeps running forever when you run start n=node(*) return n; is because the system is usually attempting to cache everything, either that or trying to return all that data is too much for the system to parse and return. I don't believe there is a Cypher way of returning nodes 1-1,000,000 without having to put them all coma separated in the START clause.

    Are you required to use Cypher? It would be fantastic if you could use the native Java API for this as it would all you to perform your processing there on each node, instead of returning them if they are not needed outside of a query.

    One answer may be the following: START n=node(*) RETURN n ORDER BY n.property LIMIT 1