CRUD Operations in neo4j

作者: Calpa Liu
字數:972
出版日期:August 18, 2022
更新日期:August 18, 2022

## Create

Create

CREATE (n:Node{id: 1})
RETURN n

Read

We can use the MATCH clause to search the patterns. In order to get all Nodes that are labelled Node, we can use the following cypher query:

MATCH (n:Node)
RETURN

Update

We can use SET clause to update the property on the node or relationship

MATCH (n:Node)
SET n.modifiedAt = datetime()
RETURN n

Delete

We can use the DETACH DELETE clause to delete a nodes and any relationships going or from it.

MATCH (n:Node{id: 1})
DETACH DELETE n

Reference

  1. CREATE - neo4j cypher user manual
  2. MATCH - neo4j cypher user manual
  3. SET - neo4j cypher user manual
  4. DELETE - neo4j cypher user manual
感謝您閱讀我的文章。歡迎隨時分享你的想法。
關於 Calpa

Calpa 擅長使用 TypeScript、React.js 和 Vue.js 開發Responsive Web Design網站。

此外,Calpa 積極參與香港和台灣的開源社區,曾在2019年的香港開源大會上擔任講者,提供工作經驗和見解。此外,他也在 GitHub 上公開分享個人博客程式碼,已獲得超過300顆星星和60個分支的支持。

更多前端開發技術文章:傳送門