Share via

CosmosDB Table API - Order by Datetime

Nathan Guimaraes 21 Reputation points Microsoft Employee
2020-12-10T16:54:08.913+00:00

Hi there,

I'm trying to order a query by datetime in one of my tables on CosmosDB Table API but the data returned is not being properly ordered. My project is tied to old libraries if very little room for upgrades.

Environment Information:

  • WindowsAzure.Storage 9.3.3.
  • .Net Framework 4.6.1

I have tried different approaches like:
datetime'<datetimeUTC>' and simply using TableQuery.GenerateFilterCondition

Is there any option left to try?

Regards.

Nathan Guimaraes.

Azure Table Storage
Azure Table Storage

An Azure service that stores structured NoSQL data in the cloud.

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

0 comments No comments

Answer accepted by question author

KalyanChanumolu-MSFT 8,361 Reputation points
2020-12-11T06:58:02.82+00:00

@Nathan Guimaraes Welcome to Microsoft Q&A forums and thank you for your interest in Azure services.

OrderBy support is made available in newer SDK's Microsoft.Azure.Cosmos.Table and Azure.Data.Tables (beta)
Unfortunately, for the older SDK version that you are using, OrderBy is not supported. You will have to sort the results at client side.

----------

If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.