@@ -18,6 +18,26 @@ ORDER BY accountDistance, otherId, mediumId;
18
18
[{"accountDistance":1,"mediumId":1,"mediumType":"Medium1","otherId":2},{"accountDistance":1,"mediumId":5,"mediumType":"Medium5","otherId":9},{"accountDistance":2,"mediumId":16,"mediumType":"Medium16","otherId":12}]
19
19
20
20
21
+ # complex read 1
22
+ MATCH p = (acc:Account {id:6})
23
+ -[e1:transfer *1..3]
24
+ ->(other:Account)<-[e2:signIn]-(medium)
25
+ WHERE
26
+ isAsc(getMemberProp(e1, 'timestamp'))=true
27
+ AND head(getMemberProp(e1, 'timestamp')) > 10
28
+ AND last(getMemberProp(e1, 'timestamp')) < 30
29
+ AND e2.timestamp > 10
30
+ AND e2.timestamp < 30
31
+ AND medium.isBlocked = true
32
+ RETURN DISTINCT
33
+ other.id as otherId,
34
+ length(p)-1 as accountDistance,
35
+ medium.id as mediumId,
36
+ medium.type as mediumType
37
+ ORDER BY accountDistance, otherId, mediumId;
38
+ [{"accountDistance":1,"mediumId":19,"mediumType":"Medium19","otherId":1},{"accountDistance":2,"mediumId":8,"mediumType":"Medium8","otherId":18}]
39
+
40
+
21
41
# complex read 2
22
42
MATCH (p:Person {id:12})-[e1:own]->(acc:Account)
23
43
<-[e2:transfer*1..3]-(other:Account)
@@ -42,6 +62,30 @@ ORDER BY sumLoanAmount DESC, otherId ASC;
42
62
[{"otherId":6,"sumLoanAmount":279.0,"sumLoanBalance":134.0},{"otherId":17,"sumLoanAmount":157.0,"sumLoanBalance":25.0},{"otherId":14,"sumLoanAmount":85.0,"sumLoanBalance":51.0},{"otherId":18,"sumLoanAmount":57.0,"sumLoanBalance":80.0},{"otherId":5,"sumLoanAmount":16.0,"sumLoanBalance":28.0},{"otherId":0,"sumLoanAmount":13.0,"sumLoanBalance":0.0}]
43
63
44
64
65
+ # complex read 2
66
+ MATCH (p:Person {id:6})-[e1:own]->(acc:Account)
67
+ <-[e2:transfer*1..3]-(other:Account)
68
+ WHERE
69
+ isDesc(getMemberProp(e2, 'timestamp'))=true
70
+ AND head(getMemberProp(e2, 'timestamp')) < 30
71
+ AND last(getMemberProp(e2, 'timestamp')) > 10
72
+ WITH DISTINCT other
73
+ MATCH (other)<-[e3:deposit]-(loan:Loan)
74
+ WHERE
75
+ e3.timestamp > 10
76
+ AND e3.timestamp < 30
77
+ WITH
78
+ other.id AS otherId,
79
+ sum(loan.loanAmount) as sumLoanAmount,
80
+ sum(loan.balance) as sumLoanBalance
81
+ RETURN
82
+ otherId,
83
+ round(sumLoanAmount * 1000) / 1000 as sumLoanAmount,
84
+ round(sumLoanBalance * 1000) / 1000 as sumLoanBalance
85
+ ORDER BY sumLoanAmount DESC, otherId ASC;
86
+ [{"otherId":17,"sumLoanAmount":157.0,"sumLoanBalance":25.0},{"otherId":14,"sumLoanAmount":85.0,"sumLoanBalance":51.0},{"otherId":13,"sumLoanAmount":62.0,"sumLoanBalance":6.0},{"otherId":12,"sumLoanAmount":57.0,"sumLoanBalance":80.0}]
87
+
88
+
45
89
# complex read 3
46
90
MATCH (src:Account{id:2}), (dst:Account{id:3})
47
91
CALL algo.shortestPath(
@@ -126,6 +170,23 @@ RETURN path;
126
170
[{"path":[0,9]},{"path":[17,15]}]
127
171
128
172
173
+ # complex read 5
174
+ MATCH (person:Person {id: 6})-[e1:own]->(src:Account)
175
+ WITH src
176
+ MATCH p=(src)-[e2:transfer*1..3]->(dst:Account)
177
+ WHERE
178
+ isAsc(getMemberProp(e2, 'timestamp'))=true
179
+ AND head(getMemberProp(e2, 'timestamp')) > 40
180
+ AND last(getMemberProp(e2, 'timestamp')) < 45
181
+ WITH DISTINCT
182
+ getMemberProp(nodes(p), "id") as path,
183
+ length(p) as len
184
+ ORDER BY len DESC
185
+ WHERE hasDuplicates(path)=false
186
+ RETURN path;
187
+ [{"path":[6,16]},{"path":[9,12]},{"path":[18,2]}]
188
+
189
+
129
190
# complex read 6
130
191
MATCH (dstCard:Account {id: 15} )<-[edge2:withdraw]-(mid:Account)
131
192
WHERE
@@ -278,6 +339,24 @@ RETURN
278
339
[{"numLoans":4,"sumLoanAmount":300.0}]
279
340
280
341
342
+ # complex read 11
343
+ MATCH
344
+ (p1:Person {id:10})-[edge:guarantee*1..5]->(pN:Person)
345
+ -[:apply]->(loan:Loan)
346
+ WHERE
347
+ minInList(getMemberProp(edge, 'timestamp')) > 10
348
+ AND maxInList(getMemberProp(edge, 'timestamp')) < 50
349
+ WITH
350
+ DISTINCT loan
351
+ WITH
352
+ sum(loan.loanAmount) as sumLoanAmount,
353
+ count(distinct loan) as numLoans
354
+ RETURN
355
+ round(sumLoanAmount * 1000) / 1000 as sumLoanAmount,
356
+ numLoans;
357
+ [{"numLoans":7,"sumLoanAmount":343.0}]
358
+
359
+
281
360
# complex read 12
282
361
MATCH
283
362
(person:Person {id:12})-[edge1:own]->(pAcc:Account)
0 commit comments