【发布时间】:2026-02-20 11:30:01
【问题描述】:
我在使用 nodejs 的 neo4j 计数请求时遇到问题。
这是我的问题: 当我插入数据时,它会呈现如下:
start a = node(0)
create unique a-[:HAS_ID]->(b{id:'xx'})
create unique b-[:HAS_INFO]->(c{info:'xx'})
return a,b,c;
因为它是唯一的节点,所以如果存在相同的节点,它不会插入新的节点。但是,我想计算调用此查询的请求数。 例如:
request: -domain/id01/info
--return a node[0], b node[1] and c node[2]
添加另一个数据:
request: -domain/id02/info
-- return : a node[0], b node[3], c node[4]
再次调用它:
request: -domain/id01/info
--return a node[0], b node[1] and c node[2] //but here is any attribute or properties count to 2.
我读过任何关于力量的解决方案。它告诉我创建一个关系属性作为示例:
[:HAS_INFO{strength:num}]
让它增加,但我还是不明白。 任何人都请给我解决方案并告诉我该怎么做。 谢谢。
更多信息:Representing (and incrementing) relationship strength in Neo4j
【问题讨论】:
标签: node.js neo4j graph-databases