0

In my database i have two nodes , that are very Similar. difference of property :lat and lng between two nodes are very small . I want to combine two nodes as one node. and make all relationship link to that node.

the following are two nodes (propertys)

node1 {name:'railway station',lat:36.699,lng:119.1}
node2 {name:'railway station',lat:36.7,lng:119.099}

How to do it with cypher? i think it should have 'where' statement like:

WHERE ABS(node1.lat-node2.lat)<0.001 and ABS(node1.lng-node2.lng)<0.001 
pangguoming
  • 115
  • 2
  • 9
  • Are the nodes connected in any way by relationships? If not, you'll be doing pairwise combination of every set of two nodes in the DB which will be slow. – FrobberOfBits Oct 19 '15 at 15:41
  • Which node is the "winner"? I.e. should node1 or node2 be kept in your example? – FrobberOfBits Oct 19 '15 at 15:41
  • Do the relationships that you're copying have any attriubutes/properties on them? If not, see http://stackoverflow.com/questions/27984668/move-copy-all-relationships-to-different-node – FrobberOfBits Oct 19 '15 at 15:44
  • i want to delete node2 , make all relationship that link to node2 relink to node1 – pangguoming Oct 20 '15 at 02:01

0 Answers0