如何从 apache gremlin 获取最新的 属性 顶点?

How to get the latest property of vertex from apache gremlin?

如何从 apache gremlin 获取最新的 属性 顶点?

使用同一个键,我们可以添加多个属性。

vp[status->new]
vp[pre_signed_url->https://e-voting.s3.]
vp[pre_signed_url->https://e-voting.s3.]
vp[pre_signed_url->https://e-voting.s3.]
vp[round_number->2]

在上面的例子中,pre_signed_url 有 3 个不同的值。

如何添加 latest/recently 属性?

TinkerPop 不保证以任何特定顺序检索集合和列表。对于某些实现,tail 可能是最新的,但您不应该依赖它。集合或列表中的每个 属性 都有一个 ID。在某些情况下,您可以使用它,但同样不是普遍可靠的。

因此,如果您使用的数据库支持元属性,您可以为每个集合成员指定一个日期或时间戳。但是,我认为最简单的解决方案就是在每个顶点上正确维护最新的URL。