Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.post('/movie/path',function(req,res) {
  2.   var title = req.body.title;
  3.   var title2 = req.body.title2;
  4.   session
  5.     .run('match (m1:Movie)<-[:ACTED_IN]-()-[:ACTED_IN]->(m2:Movie) merge (m1)-[:HASSAMEACTOR]-(m2)')
  6.     .then{(
  7.       .session
  8.         .run('match (m1:Movie {title:{titleParam}}), (m2:Movie {title:{titleParam2}}), path = shortestpath((m1)-[:HASSAMEACTOR*]-(m2)) return path',{titleParam:title,titleParam2:title2})
  9.         .then(function(result) {
  10.           res.redirect('/');
  11.           session.close();
  12.     })
  13.     .catch(function(err) {
  14.       console.log(err)
  15.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement