Is your feature request related to a problem?
Currently, the only way to apply ordering is to use a plain query().
Describe the solution
Add an orderBy(field: string, order: 'ASC'|'DESC' = 'ASC') method to selectPromise which generates an ORDER BY SQL clause internally.
Alternative methods
This would be a lot more work (in the surreal package as well) and might deserve its own feature request, but here it goes:
Add the ability to sort by a surreal function. Obviously, the function must pre-exist in the database. Then:
Add a sort(function: string) method to selectPromise which passes the whole query as an argument to the function and returns the function's result.
A lot of things can break this; so sorting functions could use their own UI form in Surrealist.
P.S. I don't really need sort(), maybe someone else does.
SurrealDB version
3.0.3 for linux on x86_64
JavaScript SDK version
2.0.2
Contact Details
rallisf1@yahoo.gr
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)
Is your feature request related to a problem?
Currently, the only way to apply ordering is to use a plain
query().Describe the solution
Add an
orderBy(field: string, order: 'ASC'|'DESC' = 'ASC')method toselectPromisewhich generates anORDER BYSQL clause internally.Alternative methods
This would be a lot more work (in the surreal package as well) and might deserve its own feature request, but here it goes:
Add the ability to sort by a surreal function. Obviously, the function must pre-exist in the database. Then:
Add a
sort(function: string)method toselectPromisewhich passes the whole query as an argument to the function and returns the function's result.A lot of things can break this; so sorting functions could use their own UI form in Surrealist.
P.S. I don't really need
sort(), maybe someone else does.SurrealDB version
3.0.3 for linux on x86_64
JavaScript SDK version
2.0.2
Contact Details
rallisf1@yahoo.gr
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)