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 日常幫助客戶構建一站式網站應用,手機應用,雲端架構

2023 年 9 月,Calpa 應邀出席韓國 Korea Blockchain Week 2023,新加坡 TOKEN 2049。十二月份,Calpa 將參加 Taipei Blockchain Week Hackathon。

Calpa 擅長運用各種前沿技術,包括 TypeScript、React.js 和 Vue.js,開發具有 Responsive Web Design 的網站。另外,他透過運用 aws-cdk 和 TypeScript 技術的融合,實現了基於雲端的「基礎即代碼」(Infrastructure as Code)部署策略,建立了多套高效且具有可伸縮性的全端架構。

同時,Calpa 積極參與各個社群,活躍於香港和台灣的開源社區,分享前沿知識。他曾在 2019 年的香港開源大會中擔任重要講者,為聽眾提供寶貴的工作經驗和深刻見解。此外,Calpa 在 GitHub 上公開分享了個人博客程式碼,已獲得超過 300 顆星星和 60 個分支。