cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Relationships bulk update properties help

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.

2X_1_11959703f96d01af1dc04c1952f1618796d43250.png

0 REPLIES 0