Is it possible to do the range query against a Edge?
I'm doing "collection.range(attribute, left, right)", where collection is in fact a Edge.
And I got a "not implemented" error on ArangoDB 2.3.3(Win64).
Yes, it is possible also for edge collections. All that is required is a skiplist index on the attribute you want to run the range query on. Here's an example demoing 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 no index is present, the in fact the "not implemented" may be thrown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With