随着小鬼,你可以通过指数范围:
// for the second ten links
g.v(1).outE.has('time',T.gte, fiveDaysAgoInMs)[10..19]
// for the previous ten links
g.v(1).outE.has('time',T.gte, fiveDaysAgoInMs)[0..9]
// for the next ten links
g.v(1).outE.has('time',T.gte, fiveDaysAgoInMs)[20..29]
// for one link only
g.v(1).outE.has('time',T.gte, fiveDaysAgoInMs)[0..<1]
来源:GremlinDocs
在Java代码:
Graph g = ... // a reference to a Blueprints graph
GremlinePipeline pipe = new GremlinPipeline();
Long DAY_IN_MS = 1000 * 60 * 60 * 24;
// first 10
pipe.start(g.getVertex(1)).outE().has("time", Tokens.gte, new Date(date.getTime() - (5 * DAY_IN_MS))).range(0, 10));
// if you want next 10
pipe.next(10);
来源:GremlinPipeline,Using Gremlin though Java
我该怎么办同样使用java代码? – manish
用Java代码更新 – MarcoL
'DAY_IN_MS'什么是它的值 – manish