Mostrar todos los nodos y relaciones


¿Cómo puedo mostrar todos los nodos y relaciones en la pestaña Data Browser?

¿Qué son las consultas de índice de muestra que puedo escribir en el campo de búsqueda?

 32
Author: Adam Stelmaszczyk, 2011-12-04

7 answers

Hay un pequeño icono de ayuda al lado del campo de búsqueda, si hoover sobre él muestra la sintaxis.

Si una propiedad de sus nodos y relaciones está indexada, puede buscar todos ellos de esta manera.

node:index:indexname:fieldname:*
rels:index:indexname:fieldname:*
 9
Author: Michael Hunger,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-12-04 03:43:28

Es posible que también desee probar una consulta de cifrado como:

START n=node(*) RETURN n;

Es muy obvio, y devolverá todos los nodos existentes en la base de datos.

EDITAR: lo siguiente muestra los nodos y las relaciones:

START n=node(*) MATCH (n)-[r]->(m) RETURN n,r,m;
 48
Author: pimguilherme,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-10-01 15:14:08

La forma más simple es

MATCH (n) RETURN (n)
 10
Author: Aniruddha Chakraborty,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-11 15:11:31

Puedes mostrar todo con simple MATCH (n) RETURN n, como sugiere la documentación oficial .

START n=node(*) RETURN n de Neo4j 2.0 es obsoleto:

La cláusula START solo debe usarse cuando se accede a índices heredados (ver Capítulo 34, Indexación heredada). En todos los demás casos, utilizar MATCH en su lugar (ver Sección 10.1, "Match").

 8
Author: Adam Stelmaszczyk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-05 20:53:18
MATCH (n) OPTIONAL MATCH (n)-[r]-() RETURN n, r;
 7
Author: Toothless Seer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-18 20:57:34

Otra buena manera de obtener TODOS los nodos (y nodos sin relación):

MATCH (n) RETURN n UNION START n = rel(*) return n;
 1
Author: VincentLamoute,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-01-14 16:11:24

Encontré que esto funcionó, recuperando todos los nodos, incluidos los huérfanos, y todas las relaciones:

MATCH (n) MATCH ()-[r]->() RETURN n, r
 1
Author: sharon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-06 18:34:01