From e541f7515d1ace27d9523048211a209dd6367743 Mon Sep 17 00:00:00 2001 From: jimingquan <6930445+nevermore3@users.noreply.github.com> Date: Mon, 8 Aug 2022 19:39:20 +0800 Subject: [PATCH] replace is1 & is3 with go --- nebula/queries/interactive-short-1.ngql | 12 +----------- nebula/queries/interactive-short-3.ngql | 9 +-------- nebula/queries/interactive-short-5.ngql | 7 +------ 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/nebula/queries/interactive-short-1.ngql b/nebula/queries/interactive-short-1.ngql index fa3a7911d..7a6eea8dd 100644 --- a/nebula/queries/interactive-short-1.ngql +++ b/nebula/queries/interactive-short-1.ngql @@ -1,11 +1 @@ -MATCH (n:Person)-[:IS_LOCATED_IN]->(p:Place) -WHERE id(n)==$personId -RETURN - n.Person.firstName AS firstName, - n.Person.lastName AS lastName, - n.Person.birthday AS birthday, - n.Person.locationIP AS locationIP, - n.Person.browserUsed AS browserUsed, - id(p) AS cityId, - n.Person.gender AS gender, - n.Person.creationDate AS creationDate \ No newline at end of file +GO FROM $personId OVER IS_LOCATED_IN YIELD $^.Person.firstName AS firstName, $^.Person.lastName AS lastName, $^.Person.birthday AS birthday, $^.Person.locationIP AS locationIP, $^.Person.browserUsed AS browserUsed, IS_LOCATED_IN._dst AS cityId, $^.Person.gender AS gender, $^.Person.creationDate AS creationDate \ No newline at end of file diff --git a/nebula/queries/interactive-short-3.ngql b/nebula/queries/interactive-short-3.ngql index 0c557e5bd..1aa96295c 100644 --- a/nebula/queries/interactive-short-3.ngql +++ b/nebula/queries/interactive-short-3.ngql @@ -1,8 +1 @@ -MATCH (n:Person)-[r:KNOWS]-(friend) - WHERE id(n) == $personId - RETURN - toInteger(substr(id(friend), 2)) AS personId, - friend.Person.firstName AS firstName, - friend.Person.lastName AS lastName, - r.creationDate AS friendshipCreationDate - ORDER BY friendshipCreationDate DESC, personId ASC \ No newline at end of file + GO FROM $personId OVER KNOWS BIDIRECT YIELD toInteger(substr(KNOWS._dst, 2)) AS personId, $$.Person.firstName AS firstName, $$.Person.lastName AS lastName, KNOWS.creationDate AS friendshipCreationDate | ORDER BY $-.friendshipCreationDate DESC, $-.personId ASC \ No newline at end of file diff --git a/nebula/queries/interactive-short-5.ngql b/nebula/queries/interactive-short-5.ngql index 9c0d2f844..8ca6f2afe 100644 --- a/nebula/queries/interactive-short-5.ngql +++ b/nebula/queries/interactive-short-5.ngql @@ -1,6 +1 @@ -MATCH (m)-[:POST_HAS_CREATOR | COMMENT_HAS_CREATOR]->(p:Person) - WHERE id(m) == $commentId OR id(m) == $postId - RETURN - id(p) AS personId, - p.Person.firstName AS firstName, - p.Person.lastName AS lastName \ No newline at end of file +GO FROM $commentId OVER COMMENT_HAS_CREATOR YIELD COMMENT_HAS_CREATOR._dst AS personId, $$.Person.firstName AS firstName, $$.Person.lastName AS lastName UNION GO FROM $postId OVER POST_HAS_CREATOR YIELD POST_HAS_CREATOR._dst AS personId, $$.Person.firstName AS firstName, $$.Person.lastName AS lastName \ No newline at end of file