假设我插入以下的顶点和边:
create tag User(
name string,
username string,
phone_number string
);
create edge follows(count int default 0);
create tag index User_index_name on User(name(50));
create tag index User_index_username on User(username(50));
1,问题1:lookup 查询中变量失效
假设执行以下lookup查询:
LOOKUP ON User WHERE User.username == "jack";
在1.0中查询结果应该是这样子的:
============
| VertexID |
============
| 101 |
------------
而在2.0中查询结果是这样子:
+----------------------+
| _vid |
+----------------------+
| "145171858868801536" |
+----------------------+
但这不是问题所在,问题在于VertexID和_vid都无法被变量使用,都报错了:
1,LOOKUP ON User WHERE User.username== "jack" YIELD User.name AS name | \
GO FROM $-.VertexID OVER follows YIELD $-.name, follows.count;
// 报错:SemanticError: `$-.VertexID', not exist prop `VertexID'
2,LOOKUP ON User WHERE User.username== "jack" YIELD User.name AS name | \
GO FROM $-._vid OVER follows YIELD $-.name, follows.count;
// 报错:SyntaxError: syntax error near `_vid OVE'
2,问题2:match 如何返回vid
MATCH (v:User) WHERE v.username == "jack" RETURN v.name AS name;
只能返回非vid字段,不知道怎么返回vid,文档没说。试了下VertexID、_vid、id都不行。