Questions tagged [neo4j]

Neo4j is an open-source graph database (GDB) well suited to connected data. Please mention your exact version of Neo4j when asking questions. You can use it for recommendation engines, fraud detection, graph-based search, network ops/security, and many other user cases. The database is accessed via official drivers in Java, JavaScript, Python and .NET, or community-contributed drivers in PHP, Ruby, R, Golang, Elixir, Swift and more.

Neo4j is a open-source, transactional, high-performance native graph database.

Neo4j stores its data as a graph: Nodes are connected through Relationships, both with arbitrary properties. Neo4j features a graph-centric declarative query language called Cypher. Its drivers support many programming languages. More details in the Online Training and the Neo4j Manual.

Neo4j offers a fully-managed cloud database (Database as a service) called Neo4j AuraDB.

For questions that are not suitable for the Stack Overflow Q&A Format, please reach out on Discord. Neo4j also maintains a public Feedback Board for feature ideas and future development directions.


Useful Links

External Resources


Related Tags

22696 questions
34
votes
6 answers

get all relationships for a node with cypher

I would like to find out all the incoming and outgoing relationships for a node. I tried couple of queries suggested in other questions but not having much luck. These are the two I tried MATCH (a:User {username: "user6"})-[r*]-(b) RETURN a, r, b I…
jas
  • 1,539
  • 5
  • 17
  • 30
34
votes
2 answers

Why does neo4j warn: "This query builds a cartesian product between disconnected patterns"?

I'm defining the relationship between two entities, Gene and Chromosome, in what I think is the simple and normal way, after importing the data from CSV: MATCH (g:Gene),(c:Chromosome) WHERE g.chromosomeID = c.chromosomeID CREATE…
Sam Hokin
  • 660
  • 1
  • 6
  • 15
33
votes
6 answers

neo4j cypher: how to change the type of a relationship

I can't find a way to change a relationship type in Cypher. Is this operation possible at all? If not: what's the best way achieve this result?
Sovos
  • 3,330
  • 7
  • 25
  • 36
33
votes
3 answers

How to create unique constraint involving multiple properties in Neo4J

I know I can create a unique constraint on a single property with Cypher like CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE. But I was wondering whether it is possible to create a unique constraint which involves multiple properties. If…
victorx
  • 3,267
  • 2
  • 25
  • 35
33
votes
3 answers

How to push values to property array in Cypher?

I have two nodes user and files with a relationship :contains, the relationship has a property idwhich is an array, represented as (:user)-[:contains{id:[12345]}]->(:files) However I want to populate the property array id with values 1111 and 14567…
SarathSprakash
  • 4,614
  • 2
  • 19
  • 35
33
votes
1 answer

How does Datomic compare to Neo4j?

I am looking at integrating Neo4j into a Clojure system I am building. The first question I was asked was why I didn't use Datomic. Does anyone have a good answer for this? I have heard of and seen videos on Datomic, but I don't know enough about…
yazz.com
  • 57,320
  • 66
  • 234
  • 385
32
votes
5 answers

neo4j: What is the syntax to set cypher query parameters in the browser interface?

I am trying to run queries from the neo4j browser to reproduce results from my neo4j-javascript-driver client. What is the syntax for defining query parameters in the neo4j b I recently attended a neo4j training session in NYC where the trainer…
Joel Stevick
  • 1,638
  • 2
  • 16
  • 22
32
votes
2 answers

Excluding label names in simple Neo4j Query

Usually I can find everything I need already on SO but not this time. I'm looking for a very simple way to exclude labels, for example (pseudo code): match (n) where n not in (Label1, Label2) return n Sorry about crappy query. In short I have…
Ed Baker
  • 643
  • 1
  • 6
  • 16
32
votes
4 answers

Change node label in neo4j

I have created a node with a wrong label. Is there any way to change node label or relationship type without re-creating it? I have tried something like MATCH n WHERE Id(n)=14 SET n.Labels = 'Person' but it is fault...
tsdaemon
  • 1,439
  • 2
  • 12
  • 14
32
votes
7 answers

How can I return all properties for a node using Cypher?

I understand it is possible to use the wildcard (*) symbol to return all references in a Cypher query, such as: MATCH p:Product WHERE p.price='1950' RETURN *; ==> +----------------------------------------------------------------+ ==> | p …
DavidJ
  • 4,369
  • 4
  • 26
  • 42
32
votes
3 answers

Graph DBs vs. Document DBs vs. Triplestores

This is a somewhat abstract and general question. I'm interested in the inherent (as well as implementation-specific) properties of different approaches to persist unstructured data with both lots of internal references (graph-like) and lots of…
mb21
  • 34,845
  • 8
  • 116
  • 142
31
votes
6 answers

Neo4j - How to delete unused property keys from browser?

I've deleted all my nodes and relationships (Delete all nodes and relationships in neo4j 1.8), but I see that in Neo4j Browser the "property keys" that existed before the deletion remain. See the picture below: How can I make all the "Property…
jotadepicas
  • 2,389
  • 2
  • 26
  • 48
31
votes
1 answer

how to add a property to existing node neo4j cypher?

i have created a new node labeled User CREATE (n:User) i want to add a name property to my User node i tried it by MATCH (n { label: 'User' }) SET n.surname = 'Taylor' RETURN n but seems it is not affecting . how can i add properties to a…
Kanishka Panamaldeniya
  • 17,302
  • 31
  • 123
  • 193
31
votes
1 answer

Difference between merge and create unique in Neo4j

I'm trying to figure out what is the difference between MERGE and CREATE UNIQUE. I know these features: MERGE I'm able to create node, if doesn't exist pattern. MERGE (n { name:"X" }) RETURN n; This create node "n" with property name, empty…
EdWood
  • 875
  • 3
  • 19
  • 37
30
votes
3 answers

How to get node's id with cypher request?

I'm using neo4j and making executing this query: MATCH (n:Person) RETURN n.name LIMIT 5 I'm getting the names but i need the ids too. Please help!
Aleksandrenko
  • 2,987
  • 6
  • 28
  • 34