Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

neo4j

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

April 7, 2024 by Tarik

In neo4j-browser you need type for example: :params {nodes: [{name: “John”, age: 18}, {name: “Phill”, age: 23}]} Then you can use params as usual: UNWIND {nodes} as node MERGE (A:User {name: node.name, age: node.age}) RETURN A For clear params in neo4j-browser type :params {}. For additional help type :help params.

Categories neo4j Tags cypher, neo4j Leave a comment

Neo4j – How to delete unused property keys from browser?

January 9, 2024 by Tarik

You should be able to clear everything out by: stopping your Neo4j database deleting everything matching data/graph.db/* (look inside the graph.db folder) starting up again.

Categories neo4j Tags neo4j, nosql Leave a comment

how to add a property to existing node neo4j cypher?

January 4, 2024 by Tarik

Your matching by label is incorrect, the query should be: MATCH (n:User) SET n.surname=”Taylor” RETURN n What you wrote is: “match a user whose label property is User”. Label isn’t a property, this is a notion apart. As Michael mentioned, if you want to match a node with a specific property, you’ve got two alternatives: … Read more

Categories neo4j Tags cypher, graph-databases, neo4j Leave a comment

How to create unique constraint involving multiple properties in Neo4J

December 12, 2023 by Tarik

neo4j (2.0.1) does not currently support a uniqueness constraint that covers multiple properties simultaneously. However, I can think of a workaround that might be acceptable, depending on your use cases. Let’s say you want properties a, b, and c to be unique as a group. You can add an extra property, d, that concatenates the … Read more

Categories neo4j Tags cypher, neo4j Leave a comment

Excluding label names in simple Neo4j Query

December 11, 2023 by Tarik

This should do it: MATCH (n) WHERE NOT n:Label1 AND NOT n:Label2 RETURN n;

Categories neo4j Tags cypher, neo4j Leave a comment

Change node label in neo4j

December 9, 2023 by Tarik

MATCH (n:OLD_LABEL {id:14}) REMOVE n:OLD_LABEL SET n:NEW_LABEL Guess this query explains itself.

Categories neo4j Tags cypher, neo4j Leave a comment

neo4j cypher: how to change the type of a relationship

December 9, 2023 by Tarik

Unfortunately there is no direct change of rel-type possible at the moment. You can do: MATCH (n:User {name:”foo”})-[r:REL]->(m:User {name:”bar”}) CREATE (n)-[r2:NEWREL]->(m) // copy properties, if necessary SET r2 = r WITH r DELETE r

Categories neo4j Tags cypher, neo4j Leave a comment

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

December 3, 2023 by Tarik

The browser is telling you that: It is handling your query by doing a comparison between every Gene instance and every Chromosome instance. If your DB has G genes and C chromosomes, then the complexity of the query is O(GC). For instance, if we are working with the human genome, there are 46 chromosomes and … Read more

Categories neo4j Tags cypher, neo4j Leave a comment

What’s the Cypher script to delete a node by ID?

November 23, 2023 by Tarik

Assuming you’re referring to Neo4j’s internal node id: MATCH (p:Person) where ID(p)=1 OPTIONAL MATCH (p)-[r]-() //drops p’s relations DELETE r,p If you’re referring to your own property ‘id’ on the node: MATCH (p:Person {id:1}) OPTIONAL MATCH (p)-[r]-() //drops p’s relations DELETE r,p

Categories neo4j Tags cypher, graph-databases, neo4j, nosql Leave a comment

get all relationships for a node with cypher

September 24, 2023 by Tarik

The simplest way to get all relationships for a single node is like this: MATCH (:User {username: ‘user6’})-[r]-() RETURN r

Categories neo4j Tags cypher, neo4j Leave a comment
Older posts
Page1 Page2 … Page4 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa