Limitations of Ordered Views

Users of relational databases, or “cheating” document databases like Cosmos DB, are used to be able to order items as part of a query. This is a costly enhancement and is not really possible in a pure document database like Gyxi DB. Instead, a view must be created with the desired order. This allows for an incredibly efficient call of items in the desired order.

Views in Gyxi are ordered by the id – and in order to achieve ordering, the id is altered according to an algorithm, supporting ascending and descending ordering or dates, numbers and text. In effect, it is not possible to use GetItem on a view that uses “orderBy” as part of the view.

If you want to get items based on the property that you also use to “orderBy” in a view, the solution is simple. Create two views. One can use “orderBy” and the other can use “idBy”, both with the same property.

For the same reason, “orderBy” and “idBy” can never be used together, as “orderBy” alters the id in order to achieve the desired order.

Business Registration Number DK28916779  

Resources