Skip to content

Commit

Permalink
Relational expressions in lookup (#774)
Browse files Browse the repository at this point in the history
* added relational expressions in lookup

* update
  • Loading branch information
cooper-lzy authored Jul 27, 2021
1 parent d81014b commit 0561277
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
29 changes: 23 additions & 6 deletions docs-2.0/3.ngql-guide/7.general-query-statements/5.lookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,30 @@ nebula> LOOKUP ON player WHERE player.name == "Tony Parker";
| 101 |
------------
nebula> LOOKUP ON player WHERE player.name == "Tony Parker" \
//正则表达式匹配
nebula> LOOKUP ON player WHERE player.name =~ "^.{15,20}$" \
YIELD player.name, player.age;
=======================================
| VertexID | player.name | player.age |
=======================================
| 101 | Tony Parker | 36 |
---------------------------------------
+-------------+----------------------+------------+
| VertexID | player.name | player.age |
+-------------+----------------------+------------+
| "player147" | "Amar'e Stoudemire" | 36 |
+-------------+----------------------+------------+
| "player144" | "Shaquille O'Neal" | 47 |
+-------------+----------------------+------------+
...
nebula> LOOKUP ON player WHERE player.name CONTAINS toLower("L") \
YIELD player.name, player.age;
+-------------+---------------------+------------+
| VertexID | player.name | player.age |
+-------------+---------------------+------------+
| "player145" | "JaVale McGee" | 31 |
+-------------+---------------------+------------+
| "player144" | "Shaquille O'Neal" | 47 |
+-------------+---------------------+------------+
| "player102" | "LaMarcus Aldridge" | 33 |
+-------------+---------------------+------------+
...
nebula> LOOKUP ON player WHERE player.name == "Kobe Bryant" YIELD player.name AS name \
| GO FROM $-.VertexID OVER serve \
Expand Down
15 changes: 15 additions & 0 deletions docs-2.0/3.ngql-guide/8.clauses-and-options/where.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,21 @@ nebula> MATCH (v:player) \
+-------------------------+-------+
| "Joel Embiid" | 25 |
+-------------------------+-------+
nebula> LOOKUP ON player WHERE player.age IN [25,28] YIELD player.name, player.age;
+-------------+------------------+------------+
| VertexID | player.name | player.age |
+-------------+------------------+------------+
| "player135" | "Damian Lillard" | 28 |
+-------------+------------------+------------+
| "player131" | "Paul George" | 28 |
+-------------+------------------+------------+
| "player130" | "Joel Embiid" | 25 |
+-------------+------------------+------------+
| "player123" | "Ricky Rubio" | 28 |
+-------------+------------------+------------+
| "player106" | "Kyle Anderson" | 25 |
+-------------+------------------+------------+
```

### 结合NOT使用
Expand Down

0 comments on commit 0561277

Please sign in to comment.