mirror of https://gitee.com/bigwinds/arangodb
changed behaviour of sorting documents - front-end
This commit is contained in:
parent
19062d9d57
commit
d17402f873
|
@ -94,9 +94,14 @@
|
|||
query += this.setFiltersForQuery(bindVars);
|
||||
// Sort result, only useful for a small number of docs
|
||||
if (this.getTotal() < 12000) {
|
||||
if (this.getSort() === '_key') {
|
||||
query += " SORT TO_NUMBER(x." + this.getSort() + ") == 0 ? x."
|
||||
+ this.getSort() + " : TO_NUMBER(x." + this.getSort() + ")";
|
||||
}
|
||||
else {
|
||||
query += " SORT x." + this.getSort();
|
||||
}
|
||||
}
|
||||
|
||||
if (bindVars.count !== 'all') {
|
||||
query += " LIMIT @offset, @count RETURN x";
|
||||
|
|
Loading…
Reference in New Issue