nebula-graphopencypher

How to do random node scan in NebulaGraph database?


I tried to fetch 10 random and non-isolated nodes in the Nebula Graph database. According to their docs the query should be MATCH (n:tag)-[e]-() RETURN n LIMIT 10. But it fails to work.

The screenshots of running the query is as follows: enter image description here

What is wrong with my query? Such a simple query should not be wrong.


Solution

  • First, there is no index has been created. If you want to execute MATCH (n:tag)-[e]-() RETURN n LIMIT 10, please create at least one index.

    If you don't want to create indexes here, you must specify the direction of the edge. For example MATCH (n:tag)-[e]->() RETURN n LIMIT 10