2017-04-05 165 views
-1

我能得到精怪創造的edge & vertex時間戳邊緣時間戳

a.addEdge("has",b) 

a & b是兩個頂點。我如何獲得創建邊緣的時間?

回答

2

邊緣(或更確切地說元素)沒有任何元數據,如果這就是你要求的。創建邊時,必須將創建的時間戳存儲爲屬性。稍後,您可以像查看其他任何屬性一樣查詢時間戳。

// create the edge 
a.addEdge("has", b, "created", System.currentTimeMillis()) 

// get the timestamp 
g.V(a).outE("has").filter(inV().is(b)).values("created")