簡體   English   中英

使用邊信息創建內部Gremlin查詢

[英]Create Inner Gremlin query using edge information

我試圖在任何用戶對用戶的帖子發表評論時創建用戶通知。

我正在使用以下gremlin查詢-

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

並得到以下結果-

在此處輸入圖片說明

正在獲取邊緣的NotificationInitiatedByVertexId值。 如何使用該頂點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