Skip to content

Commit

Permalink
Merge pull request #29 from nevermore3/replace_ic11_with_go
Browse files Browse the repository at this point in the history
replace ic11 with go
  • Loading branch information
nevermore3 authored Aug 11, 2022
2 parents 84d2117 + 79be0d7 commit 682495c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions nebula/queries/interactive-complex-11.ngql
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
MATCH (person:Person)-[:KNOWS*1..2]-(friend:Person)
WHERE id(person) == $personId AND not(id(person)==id(friend))
WITH DISTINCT friend
MATCH (friend:Person)-[workAt:WORK_AT]->(company:Organisation)-[:IS_LOCATED_IN]->(:Place {name:$countryName})
WHERE workAt.workFrom < $workFromYear
RETURN
toInteger(substr(id(friend), 2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
company.Organisation.name AS organizationName,
workAt.workFrom AS organizationWorkFromYear
ORDER BY organizationWorkFromYear ASC, personId ASC, organizationName DESC
LIMIT 10
GO 1 TO 2 STEPS FROM $personId OVER KNOWS WHERE KNOWS._dst != $personId YIELD distinct KNOWS._dst AS friendId | GO FROM $-.friendId OVER WORK_AT WHERE WORK_AT.workFrom < $workFromYear YIELD $-.friendId AS friendId, $^.Person.firstName AS firstName, $^.Person.lastName AS lastName, WORK_AT.workFrom AS workFrom, WORK_AT._dst AS orgId| GO FROM $-.orgId OVER IS_LOCATED_IN WHERE $$.Place.name == $countryName YIELD toInteger(substr($-.friendId, 2)) AS personId, $-.firstName AS personFirstName, $-.lastName AS personLastName, $^.Organisation.name AS organizationName, $-.workFrom AS organizationWorkFromYear | ORDER BY $-.organizationWorkFromYear ASC, $-.personId ASC, $-.organizationName DESC | LIMIT 10

0 comments on commit 682495c

Please sign in to comment.