Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. MATCH (mainResult: Content)
  2.  
  3. OPTIONAL MATCH
  4. mainResult<-[relationship0: liked]-(target0: User)
  5.  
  6. OPTIONAL MATCH
  7. relationship0-[relationship1: liked]->(target1: Content)
  8.  
  9. OPTIONAL MATCH
  10. relationship1<-[relationship2: liked]-(target2: User)
  11.  
  12. OPTIONAL MATCH
  13. relationship2-[relationship3: liked]->(target3: Content)
  14.  
  15. WITH
  16. target1,
  17. target0
  18. {
  19. id: ID(target2),
  20. email: target2.email,
  21. password: target2.password,
  22. username: target2.username,
  23. facebookToken: target2.facebookToken,
  24. methodOfRegistration: target2.methodOfRegistration,
  25. resetPasswordToken: target2.resetPasswordToken,
  26. likedContent: collect(distinct( target3 ))
  27. } as target2
  28.  
  29. WITH
  30. target0
  31. {
  32. id: ID(target1),
  33. title: target1.title,
  34. description: target1.description,
  35. smallDescription: target1.smallDescription,
  36. location: target1.location,
  37. markerIcon: target1.markerIcon,
  38. listImage: target1.listImage,
  39. headerType: target1.headerType,
  40. headerImages: target1.headerImages,
  41. headerVideo: target1.headerVideo,
  42. tabInfo: target1.tabInfo,
  43. tabMedia: target1.tabMedia,
  44. tabContacts: target1.tabContacts,
  45. media: target1.media,
  46. startDate: target1.startDate,
  47. endDate: target1.endDate,
  48. contacts: target1.contacts,
  49. likedByUsers: collect(distinct( target2 ))
  50. } as target1
  51.  
  52. WITH
  53.  
  54. {
  55. id: ID(target0),
  56. email: target0.email,
  57. password: target0.password,
  58. username: target0.username,
  59. facebookToken: target0.facebookToken,
  60. methodOfRegistration: target0.methodOfRegistration,
  61. resetPasswordToken: target0.resetPasswordToken,
  62. likedContent: collect(distinct( target1 ))
  63. } as target0
  64.  
  65. WITH
  66.  
  67. {
  68. id: ID(mainResult),
  69. title: mainResult.title,
  70. description: mainResult.description,
  71. smallDescription: mainResult.smallDescription,
  72. location: mainResult.location,
  73. markerIcon: mainResult.markerIcon,
  74. listImage: mainResult.listImage,
  75. headerType: mainResult.headerType,
  76. headerImages: mainResult.headerImages,
  77. headerVideo: mainResult.headerVideo,
  78. tabInfo: mainResult.tabInfo,
  79. tabMedia: mainResult.tabMedia,
  80. tabContacts: mainResult.tabContacts,
  81. media: mainResult.media,
  82. startDate: mainResult.startDate,
  83. endDate: mainResult.endDate,
  84. contacts: mainResult.contacts,
  85. likedByUsers: collect(distinct( target0 ))
  86. } as mainResult
  87.  
  88. return mainResult
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement