Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WOQL.order_by: asc/desc keywords not working as documented #35

Closed
fidelthomet opened this issue Mar 3, 2021 · 0 comments · Fixed by #61
Closed

WOQL.order_by: asc/desc keywords not working as documented #35

fidelthomet opened this issue Mar 3, 2021 · 0 comments · Fixed by #61
Assignees
Labels
bug Something isn't working

Comments

@fidelthomet
Copy link
Contributor

Describe the bug
The provided example for using asc/desc keywords with WOQL.order_by does not work.

To Reproduce
query (example taken from documentation)

WOQL.order_by("v:A", "v:B asc", "v:C desc").triple("v:A", "v:B", "v:C")

Expected behavior
This should recognise the keywords and sort accordingly

Error logs
There are no error logs but returned bindings will not be ordered by v:B or v:C in any direction. Instead they contain the these keys/values

'B asc': 'system:unknown',
'C desc': 'system:unknown',

System information (please complete the following information):

Additional context
The expected behaviour can be achieved by running this query

WOQL.order_by("v:A", "v:B",  "asc", "v:C", "desc")

However, both queries feel somewhat strange to me. I would probably prefer something like

WOQL.order_by("v:A", { varName: "v:B", desc:  false}, { varName: "v:C", desc: true })

or

WOQL.order_by("v:A", ["v:B",  "asc"], ["v:C", "desc"])
@Neelterminusdb Neelterminusdb added the bug Something isn't working label Oct 15, 2021
@Neelterminusdb Neelterminusdb self-assigned this Oct 26, 2021
Neelterminusdb added a commit that referenced this issue Nov 1, 2021
Signed-off-by: NeelParihar <[email protected]>
Francesca-Bit added a commit that referenced this issue Nov 1, 2021
fix: #35 bug in order_by function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants