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

Sort not working on Cosmos DB #110

Open
carlesUdG opened this issue Jan 18, 2021 · 6 comments
Open

Sort not working on Cosmos DB #110

carlesUdG opened this issue Jan 18, 2021 · 6 comments

Comments

@carlesUdG
Copy link

carlesUdG commented Jan 18, 2021

Hi Sieve,

I've found what I think is a new issue using the Sieve with Cosmos DB. When sorting, Sieve creates a query like the following:

SELECT VALUE root FROM root ORDER BY ((root[\"vulnId\"] = null) ? null : root[\"vulnId\"]) ASC OFFSET 0 LIMIT 100.

As you can see, the ORDER BY is using a derivative of a value, instead of a property of a document, as Cosmos requires, here is the doc: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-order-by#remarks. Also here there is an example of this Cosmos limitation: https://stackoverflow.com/questions/56041767/cosmos-db-order-by-on-computed-field.

As a result, every time I sort, an error 500 is thrown by the cosmos library. Is there any way to support this Cosmos DB limitation?

Thank you!

@p3r1c0
Copy link

p3r1c0 commented Jan 19, 2021

Hi team,

I have the same error, any estimation about when it will be fixed?

Thanks!

@markferreiro
Copy link

Same here. I've been one week trying different things but didn't arrived to a solution. Did you found a way to solve it, Pingu(@carlesUdG )?

@carlesUdG
Copy link
Author

Same here. I've been one week trying different things but didn't arrived to a solution. Did you found a way to solve it, Pingu(@carlesUdG )?

I haven't found a way to solve it yet :( lets see if someone responds to this issue...

@p3r1c0
Copy link

p3r1c0 commented Jan 26, 2021

Any new about this issue? @zolrath @skolmer

@carlesUdG
Copy link
Author

I believe the problem is here:

nullCheck = GenerateOrderNullCheckExpression(propertyValue, nullCheck);
. Maybe this null check should be avoided for Cosmos DB?

@HBTeun
Copy link
Contributor

HBTeun commented Jan 27, 2022

This is also a problem for MongoDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants