what’s the syntax to get random records from a specific node_auto_index using cypher?
I suppose there is this example
START x=node:node_auto_index("uname:*") RETURN x SKIP somerandomNumber LIMIT 10;
Is there a better way that won’t return a contiguous set?
there is no feature similar to SQL’s Random() in neo4j.
you must either declare the random number in the
SKIP randomsection before you use cypher (in case you are not querying directly from console and you use any upper language with neo4j)– this will give a random section of nodes continuously in a row
or you must retrieve all the nodes and than make your own random in your upper language across these nodes – this will give you a random set of ndoes.
or, to make a pseudorandom function in cypher, we can try smthing like this:
or make a sophisticated WHERE part in this query based upon the total number of uname nodes, or the ordinary ascii value of uname param, for example