Skip to content

Commit eb1b2b4

Browse files
committed
Add script to explore a common file path
1 parent d774ce7 commit eb1b2b4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Get common global full qualified name prefix
2+
3+
MATCH (module:TS)
4+
WHERE module.globalFqn STARTS WITH '/'
5+
WITH count(module.globalFqn) AS numberOfAllModules
6+
,collect(module) AS modules
7+
UNWIND modules AS module
8+
WITH numberOfAllModules
9+
,module.globalFqn AS moduleFullQualifiedName
10+
,split(module.globalFqn, '/') AS paths
11+
UNWIND paths AS path
12+
WITH path, numberOfAllModules, count(*) AS numberOfModulesUsingThePath
13+
WHERE numberOfAllModules = numberOfModulesUsingThePath
14+
RETURN apoc.text.join(collect(path), '/') AS commonPath

0 commit comments

Comments
 (0)