
GQLINSERT (p1:Paper {_id:'P1', title:'Efficient Graph Search', score:6, author:'Alex'}), (p2:Paper {_id:'P2', title:'Optimizing Queries', score:9, author:'Alex'}), (p3:Paper {_id:'P3', title:'Path Patterns', score:7, author:'Zack'}), (p1)-[:Cites {weight:2}]->(p2), (p2)-[:Cites {weight:1}]->(p3)
Constructs a table in the RETURN statement. Each argument becomes a column in the output table. Column names default to the expression text or can be set using AS.
| Syntax | table(<column1> [, <column2>, ...]) | ||
| Arguments | Name | Type | Description |
<column> | Any | One or more expressions as columns; use AS to set column names | |
| Return Type | TABLE | ||
GQLMATCH (n:Paper)-[e:Cites]->() RETURN table(n._id AS id, n.title, e.weight AS weight)
Result:
| id | n.title | weight |
|---|---|---|
| P1 | Efficient Graph Search | 2 |
| P2 | Optimizing Queries | 1 |