0

According to this article https://learn.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide#log-tail-pattern, if save RowKey to string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks); then I can always pick the most recent record by using azure.TableQuery().top(1);

But actually it's not works like there, the most recent add row unable to be pick up. I tested it by manually adding two rows, with Rowkey in following values 2518658399914874511 and 2518658399901330034. Please advise.

Linda Liu
  • 31
  • 1
  • Please share more details, e.g. the source code. – Zhaoxing Lu Sep 09 '18 at 09:18
  • I just use the above code in the article string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks); I created two invertedTicks and then manually insert it to a Azure Cosmos Table collection, so I have two records in the Table, but they just ordered by the timestamp not the rowKey. – Linda Liu Sep 10 '18 at 05:23
  • Could you please share your source code? – Zhaoxing Lu Sep 10 '18 at 06:05
  • using System; namespace TestDate { class Program { static void Main(string[] args) { string invertedTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks); } } } – Linda Liu Sep 19 '18 at 02:15
  • It's not the full source code, could you please add the full one into the question with graceful format? – Zhaoxing Lu Sep 19 '18 at 02:27

0 Answers0