简体   繁体   English

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

[英]Create Inner Gremlin query using edge information

I'm trying to create user Notification whenever any user comments on user's post. 我试图在任何用户对用户的帖子发表评论时创建用户通知。

i'm using following gremlin query - 我正在使用以下gremlin查询-

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

and am getting following result - 并得到以下结果-

在此处输入图片说明

Am getting NotificationInitiatedByVertexId value in edge. 正在获取边缘的NotificationInitiatedByVertexId值。 how can I use that vertex id (ie. NotificationInitiatedByVertexId: 1280) to get information about the vertex in the same query result. 如何使用该顶点ID(即NotificationInitiatedByVertexId:1280)在同一查询结果中获取有关该顶点的信息。

我建议尝试将其添加到您已经拥有的transform语句中:

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)]}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM