2016-02-18 45 views
0

我試圖在任何用戶對用戶的帖子發表評論時創建用戶通知。使用邊緣信息創建內部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

我得到的邊緣NotificationInitiatedByVertexId值。我該如何使用該頂點ID(即NotificationInitiatedByVertexId:1280)來獲取有關同一查詢結果中頂點的信息。

回答

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

謝謝:)它的工作原理。 –

+0

如何將相同postInfo._id的通知分組? –