Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-17-2019 11:22 AM
Hi, I'm pretty new to Neo4j/Cyper. I was hoping someone can help me figure out why this bulk update to relationship properties is not working from the given dataset. The id value in the dataset is the neo4j ID of the relationship. tq,rpc,weight are the properties on it.
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);
});
I get no errors, it falls into success function, but no properties actually update.
All the sessions of the conference are now available online