Neo4j 基本操作總結

2021-10-23 10:14:15 字數 1699 閱讀 2884

1.建立節點

create (b:album 

)

2.建立多個節點

create (a:album ),

(b:album

)

3.建立關係

match (a:artist)

,(b:album)

where a.name =

"筷子兄弟" and b.name =

"猛龍過江"

create (a)

-[r:released]

->

(b)return r

1.匯入節點:

# 匯入department實體表

load csv with headers from

'file:/'

as line

merge (p:department

)

2.匯入關係:

# 匯入disease_to_department關係表

load csv with headers from

'file:///disease_to_department.csv'

as line

match (

from

:disease),

(to:department

)merge (

from)-

[r:department_is]-

>

(to)

1.刪除節點:

match (n:city) delete n
2.刪除關係:

match ()-

[r:cityhastime]-(

) delete r

1.批量新增屬性:為已經建立的節點新增屬性:原本level表中沒有situation,通過新舊表的lid匹配,使用match…set語句新增屬性。

load csv with headers from

'file:/'

as line

match(n:level

) set n.situation = line.situation

1.通過id匹配資料,不能像其它普通屬性一樣直接match,需要使用id(n)的格式進行匹配:

match p=()

-[r:lr]

->

() where id

(r)=

318 set r.kind:

1 return p

match (n:標籤名) return count(n)
match (n:aircraft) return distinct keys(n)
match (n:aircraft) where n.`country/

type`=

'china'

return n

match (n:aircraft) where  not exists(n.decommissioned)

return n

neo4j基本語法

bin neo4j start 啟動專案 瀏覽器開啟http ip 7474 本地瀏覽器無法訪問遠端的neo4j時,修改neo4j專案conf neo4j.conf檔案 將紅框處的注釋去掉即可 輸入使用者名稱和密碼 都是neo4j 第一次登入會要求重新設定密碼,進入如下介面 本地瀏覽器無法遠端登入n...

neo4j使用總結

埠配置 外掛程式配置 dbms.jvm.additional dunsupported.dbms.udc.source tarball org.neo4j.server.thirdparty jaxrs classes org.neo4j.tableau.wdc tableau wdc dbms.s...

Neo4j使用操作

neo4j zip環境設定 1 windows 下安裝 2 neo4j啟動 開啟cmd命令列,找到neo4j安裝目錄 在瀏覽器中開啟neo4j操作頁面 輸入賬號密碼,點選connect即可訪問資料庫。注 初始使用者名稱密碼都是neo4j,首次開啟需要修改密碼。資料庫訪問 成功連線資料庫之後進入上圖頁...