Range Query with Edge
1 answer
Yes, this is also possible for sets of ribs. All it takes is a skiplist index for the attribute you want to run the range query on. Here's an example to demonstrate it:
/* create some vertices */
var vertices = db._create("vertices");
for (var i = 0; i < 100; ++i) {
vertices.save({ _key: "v" + i });
}
/* create some edges */
var edges = db._createEdgeCollection("edges");
for (var i = 0; i < 10; ++i) {
edges.save("vertices/" + i, "vertices/" + i, { value: i });
}
/* create the index */
edges.ensureSkiplist("value");
/* run the range query */
edges.range("value", 7, 23).toArray();
If the index is not present, "not implemented" may actually be thrown.
+5
source to share