neuxregime
neuxregime
ATApache TinkerPop
Created by neuxregime on 6/20/2023 in #questions
indexOf Vertex with given property in a sorted list
As usual, this is brilliant Kelvin. I'll put this into work and report back 🙏
13 replies
ATApache TinkerPop
Created by neuxregime on 6/20/2023 in #questions
indexOf Vertex with given property in a sorted list
no worries, appreciate the help 🙏 @spmallette @KelvinL is this even possible with gremlin? I know this can be done with 2 queries: get the list and find the index of vertex with id, then submit another query with the correct range applied. But this is not really ACID compliant, that's why I'm looking for a single-query solution
13 replies
ATApache TinkerPop
Created by neuxregime on 6/20/2023 in #questions
indexOf Vertex with given property in a sorted list
so it would be something like
g.V()
.hasLabel("profile")
.order()
.by("date", gremlin.process.order.asc); // at this point we have the whole list
.range(indexOf(id=K), indexOf(id=K) + 3) // this is the hiccup,
// how to find indexOf(id=K) in the sorted result
.toList()
g.V()
.hasLabel("profile")
.order()
.by("date", gremlin.process.order.asc); // at this point we have the whole list
.range(indexOf(id=K), indexOf(id=K) + 3) // this is the hiccup,
// how to find indexOf(id=K) in the sorted result
.toList()
13 replies
ATApache TinkerPop
Created by neuxregime on 6/20/2023 in #questions
indexOf Vertex with given property in a sorted list
That's what I have in mind too, but I need to know the index of V{id:K} in advance
13 replies