https://github.com/irezaul/neo4j
Neo4j Tutorial, installation, use Command, etc.
https://github.com/irezaul/neo4j
Last synced: 3 months ago
JSON representation
Neo4j Tutorial, installation, use Command, etc.
- Host: GitHub
- URL: https://github.com/irezaul/neo4j
- Owner: irezaul
- Created: 2021-08-04T15:42:35.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-10T16:15:02.000Z (over 3 years ago)
- Last Synced: 2025-01-12T21:12:30.351Z (5 months ago)
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# neo4j
Neo4j Tutorial -
### How to Install Docker on your macOS Machine -
- [x] Installation -
- [x] [Docker_download](https://download.docker.com/mac/beta/Docker.dmg) -
- [x] Double-click the DMG file, and drag-and-drop Docker into your Applications folder.
- [x] You need to authorize the installation with your system password.
- [x] Double-click Docker.app to start Docker -
- [x] The whale in your status bar indicates Docker is running and accessible.
- [x] Docker presents some information on completing common tasks and links to the documentation.
- [x] You can access settings and other options from the whale in the status bar. a. Select About Docker to make sure you have the latest version.### Run Docker app & wait for a while to ready docker app -
> when ready docker app open terminal & run docker command -
```bash
docker run -d -p 80:80 docker/getting-started
```
## Now Start Neo4j pulling
- [x] [Neo4j_docker](https://hub.docker.com/_/neo4j)
> run this command on terminal -
```bash
docker pull neo4j --platform linux/amd64
```
> check on docker app images tab -


### Now run `neo4j` image porcess by terminal with define `port` & login `ID PASSWORD`
```bash
docker run --platform linux/amd64 -p7474:7474 -p7687:7687 -d --env NEO4J_AUTH=neo4j/test neo4j:latest
```
#### now your neo4j ready for run on your define port number.
```bash
localhost:7474
```

# Congratulation!
#### Now put your ID & Password what we define - -
```bash
ID - neo4j
Pass- test
```
#### Login done
> Command Play come -

### Okey LET'S started - `Neo4j` is a `Graph` Database, which language usage is called `Cypher` (Cypher Query Language).
>Cypher’s syntax provides a visual and logical way to match patterns of nodes and relationships in the graph. It is a declarative, SQL-inspired language for describing visual patterns in graphs using ASCII-Art syntax. It allows us to state what we want to select, insert, update, or delete from our graph data without a description of exactly how to do it. Through Cypher, users can construct expressive and efficient queries to handle needed create, read, update, and delete functionality.### Command --
* MATCH command
> `MATCH` command which like a query to find me anything matches the quiteria thay i have.
```bash
MATCH (n) RETURN (n)
```
#### MATCH `(n)` means `n` is node & RETURN `(n)` - return node

> no record found & no node found.### Now we create a node by Command-
```bash
CREATE (n)
```

> again type the match command to see node
```bash
MATCH (n) RETURN (n)
```
> see here created a node by showing graphiclly
> you can see, we did not create a relationship here and did not name the node.
### How to delete?
> delete command is -
```bash
MATCH (n) DELETE (n)
```
### How to added a `Person` with color on node -
```bash
CREATE (n:Person{name:'Master-Academy', favoritecolor:'green'})
```

### * If we need a delete a person -
```bash
MATCH (n:Person {name: 'UNKNOWN'})
DELETE n
```
### * How to find a single person by command -
```bash
MATCH (n:Person) RETURN (n)
```

### * How to Create a Relationship between in 2 Nodes --
```bash
MATCH
(a:Person),
(b:Person)
WHERE a.name = 'Mostain' AND b.name = 'Master-Academy'
CREATE (a)-[r:FOUNDER_OF]->(b)
```
> put the name of nodes on `='Name'` also type the relationship name on `r:RELATIONSHIP`
#### How to delete a relationship -
```bash
MATCH (n {name: 'NODE_NAME'})-[r:RELATIONSHIP_NAME]->()
DELETE r
```
> where `NODE_NAME` you set here your node name or person name & `r:RELATIONSHIP_NAME` here you type your relation name -
### I Create a relationship here see on image -
#### How to delete all nodes & relationship -
```bash
MATCH (n) DETACH DELETE (n)
```