http://api.neo4j.org/1.8.M06 - Look for class Node and methods family:
getRelationships().
You dont need to retrieve both nodes as you can get relationships from any
node (it's just a matter of relationship direction),
so basicly you do:
for( Relationship rel: node.getRelationships(Direction.OUTGOING,
YourRelationTypeHere) ) {
double w = (Double) rel.getProperty("weightage");
if( w == 70 ) {
w += 123.45;
rel.setProperty("weightage", w)
}
}
Keep in mind that node may have multiple relationship (depends on your
application logic), so probably
you need to do some additional filtering.
On Friday, August 3, 2012 9:10:11 AM UTC+4, tAds wrote:
> hello,
> I have 2 nodes that are related to each other.This relationship
> has a property called weightage with a value' 70 '. I want to increase the
> value. To do so, I want to retrieve the value of the property (wightage=70)
> between these two nodes.I can retrieve these two nodes.From the nodes, how
> can i get the relationship and then the property of that relationship?
> Thanks in advance. :)