我希望有人可以帮助我弄清楚为什么对给定数据集的关系属性的批量更新不起作用。数据集中的 id 值是关系的 neo4j ID。tq
,是它rpc
的weight
属性。
var batchUpdate = [{"id":281,"tq":8,"rpc":2.4,"weight":84},{"id":283,"tq":5,"rpc":1.25,"weight":10},
{"id":286,"tq":4,"rpc":3.2,"weight":5}];
var nQuery = WITH {batchUpdate} AS stats UNWIND stats AS s MATCH ()-[k:BELONGS_TO]-() WHERE id(k)=s.id SET k.weight=s.weight, k.rpc=s.rpc, k.tq=s.tq;
session
.run(nQuery,{batchUpdate:batchUpdate})
.then(function (result) {
console.log('updated');
})
.catch(function (error) {
console.log('neo4j stats update error ' + error);
});
我没有收到任何错误,它属于成功功能,但实际上没有属性更新。