Sieve
Sieve copied to clipboard
Sort not working on Cosmos DB
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!
Hi team,
I have the same error, any estimation about when it will be fixed?
Thanks!
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 )?
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...
Any new about this issue? @zolrath @skolmer
I believe the problem is here: https://github.com/Biarity/Sieve/blob/803055029e61691108d9da32c65f4c0078615f0e/Sieve/Extensions/OrderByDynamic.cs#L57. Maybe this null check should be avoided for Cosmos DB?
This is also a problem for MongoDB.