So Im using RT AQL to fetch data by filtering repo, app and branch while including custom property and sorting by 'created' sort wont work while Im using 'include' feature for example:
items.find({"repo":"my-repo","@app":"myapp", "@branch": "mybranch"})
.include("@version")
.sort({"$asc" :["created"]}).limit(50)
I would expect to get 1.0.0 (which is ok)
what I actually get: 1.0.0 , 1.0.1, 1.0.2, 1.0.3
but if I change the order to use desc
.sort({"$desc" :["created"]}).limit(50)
output will be the same
I would expect to get 1.0.3
the order I actually get: 1.0.0 , 1.0.1, 1.0.2, 1.0.3
Only if I remove the include part output will be as expected.
Any ideas?
AQL has a known limitation with sort, limit and offset, which appears under the Usage section in the documentation: