Why does my CREATE CONSTRAINT take so long to complete

When creating a constraint, for example CREATE CONSTRAINT ON (n:ZipCode) ASSERT n.name IS UNIQUE; this will require a lock on all nodes with the label the constraint is being created for, in this case ZipCode If you have another transaction… Read more →

Explore:  


How to write a Cypher query to return the top N results per category

The following Cypher describes how you can display the Top 5 test scores within an entire :Score population broken out by a field_of_study property. create (n:Score {student_id: ‘DC001’, score: 89, field_of_study: ‘chemistry’}); create (n:Score {student_id: ‘MK812’, score: 97, field_of_study: ‘chemistry’});… Read more →

Explore:  


Why doesn’t my WHERE clause work?

It can be frustrating when it seems like a WHERE clause isn’t working. You can use these approaches to figure out what’s wrong. Check for WHERE clauses following OPTIONAL MATCH WHERE clauses can’t be used on their own, they are… Read more →

Explore:  


Explanation of error “Database constraints have changed (txId=xxxxx) after this transaction (txId=yyyyy) started, which is not yet supported”

The following error, via bin/neo4j-shell: Database constraints have changed (txId=84) after this transaction (txId=81) started, which is not yet supported. Please retry your transaction to ensure all constraints are executed. or as logged in log/debug.log (3.x) or graph.db/messages.log (2.3.x): 2016-10-18… Read more →

Explore:  


Tuning Cypher queries by understanding cardinality

Cardinality issues are the most frequent culprit in slow or incorrect Cypher queries. Because of this, understanding cardinality, and using this understanding to manage cardinality issues, is a critical component in Cypher query tuning, and query correctness in general. A… Read more →

Explore:  


Properly escaping input data for neo4j-import

Note neo4j-import is intended to populate a new, empty database. It cannot be used to import into an existing database. When importing data using neo4j-import, make sure to review the required CSV file structure and considerations before moving on. http://neo4j.com/docs/stable/import-tool.html… Read more →

Explore:  


Redirect Neo4j logs to sysout (using rsyslog)

Sometimes – due to organizational requirements, security, indexing or plain convenience – we want to output all of our application logs to Linux’s sysout. While Neo4j doesn’t offer this feature, we can use RSYSLOG (www.rsyslog.com) to achieve that and we… Read more →

Explore:  


Understanding Neo4j Query Plan Caching

This article is based on the behavior of Neo4j 2.3.2. Query plan caching is governed by three parameters, as defined in the conf/neo4j.properties file, which are detailed here. The three parameters which govern whether a Cypher statement is planned/replanned are:… Read more →

Explore:  


Export a (sub)graph to Cypher script and import it again

Oftentimes you want to export a full (or partial) database to a file and import it again without copying the actual database files. If you want to do the latter, use neo4j-admin dump/load. Here are two ways on how to… Read more →

Explore:  


Using supervisord to manage Neo4j process

In general, running the neo4j process directly is the most common way to start and stop the neo4j server. However, if you use supervisord to manage processes, this has worked for others. Things to keep in mind: supervisord can only… Read more →

Explore:  


Explanation of error LOAD CSV error of “Couldn’t load the external resource …​”

When running a LOAD CSV Cypher statement, for example LOAD CSV WITH HEADERS FROM “http://10.12.1.2/Neo4j/cities.csv” AS row WITH row create (c:cities {name:row.city}); whether through bin/neo4j-shell or the browser at http://localhost:7474 this may result in an error as follows Couldn’t load… Read more →

Explore:  


How do I configure init and max java heap when running bin/neo4j-backup

When running $NEO4J_HOME/bin/neo4j-backup if a Java out of heap/memory error occurs you may want define the init and max Java heap to be used by neo4j-backup. The default behavior is to allow the JVM to define the init and max… Read more →

Explore:  


Performing match intersection

Match intersection is a common use case where you’re searching for nodes which have relationships to all of a set of input nodes. For the rest of the article we’ll use the built-in movies graph for demonstration. The example use… Read more →

Explore:  


Updating a node but returning its state from before the update

Some use cases require updating node (or relationship) properties, but returning the node (or relationship) as it was prior to the update. You’ll need to get a ‘snapshot’ of the node before the update, and return that snapshot instead of… Read more →

Explore:  


HA Proxy Configuration for Online Backup

What are we trying to achieve? Online backup should be scheduled to run periodically on a production cluster. You only need to run it on one instance, since each has its own full copy of the database. Because a full… Read more →

Explore:  


How do I automate the copy of auth files in a clustered environment

In a clustered Neo4j implementation, user authentication files are recorded in each instance at $NEO4J_HOME/data/dbms. Since this defined per each instance in the cluster if for example you change the password of a user on instance 1, for consistency you… Read more →

Explore:  


How to List and Install Neo4j Versions Using yum

Warning Prior to Neo4j 3.2, the rpm distribution of Neo4j was experimental at this time. Use with caution and we advise installing from the linux tarball in production environments. For Neo4j 3.2 please follow the instructions here Neo4j 3.0 does… Read more →

Explore: