Neo4j常用函数

字符串函数

match (n:Lianhuachi) where n.name = '去种田的向凹凸' return n.name,substring(n.name, 0,3)

AGGREGATION聚合函数

和普通SQL一致的含义

match (n:Lianhuachi) return count(n),max(n.age),min(n.age),avg(n.age),sum(n.age)

关系函数

match (x)-[n:`莲花池人物关系`]->(y) return id(n),n

备份

Neo4j 官方文档: Backup modes

➜  bin ./neo4j-admin database dump neo4j --to-path=/tmp
2024-06-26 15:24:15.414+0000 INFO  [o.n.c.d.DumpCommand] Starting dump of database 'neo4j'
Done: 37 files, 2.993MiB processed.
2024-06-26 15:24:19.338+0000 INFO  [o.n.c.d.DumpCommand] Dump completed successfully


➜  bin ll /tmp/ |grep "neo4j.dump"
-rw-r--r--  1 imyzt   wheel   305K Jun 26 23:24 neo4j.dump

恢复

Neo4j 官方文档: Restore a database dump

➜  bin ./neo4j-admin database load --from-path=/tmp/ neo4j --overwrite-destination=true
Done: 37 files, 2.993MiB processed.

可以看到,数据恢复了过来。
neo4j_restore