我希望有人能帮助我找出为什么对关系属性的批量更新在给定的数据集上不起作用。数据集中的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);
});
我没有得到错误,它落入成功函数,但没有属性实际更新。
https://stackoverflow.com/questions/55736384
复制相似问题