使用边缘信息创建内部Gremlin查询

时间:2016-02-18 14:44:28

标签: graph titan gremlin

我试图在用户评论用户评论时尝试创建用户通知。

我正在使用以下gremlin查询 -

g.v(512).outE('Notification').order{it.b.PostedDate <=> it.a.PostedDate}[0..3].transform{ [notificationInfo:it,postInfo:it.inV]}

我得到了以下结果 -

enter image description here

在Edge中获取NotificationInitiatedByVertexId值。如何使用该顶点id(即NotificationInitiatedByVertexId:1280)获取相同查询结果中的顶点信息。

1 个答案:

答案 0 :(得分:2)

我建议尝试将其添加到您已有的转换语句中:

g.v(512).outE('Notification').order{it.b.PostedDate <=> it.a.PostedDate}[0..3].transform{ [notificationInfo:it,postInfo:it.inV,notifiedV:g.v(it.NotificationInitiatedByVertexId)]}
相关问题