Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get last updated time of document in Azure Cosmos DB

I have recently started using Azure Cosmos DB in our project. For the reporting purpose, we need to get last updated time of document. I could not find any suitable API to achieve it, I looked online for solution.

Could anyone please let me know for any pointer on the above requirement? Any pointer would help me a lot.

Thanks, Satindra

like image 752
user2364893 Avatar asked Oct 16 '25 00:10

user2364893


1 Answers

For the reporting purpose, we need to get last updated time of document.

Each document has a system defined property called _ts that will tell you the date/time when the document was last updated. You simply fetch the document and look at this property to find this information.

Note: _ts is the number of seconds (not milliseconds) that have elapsed since 00:00:00 (UTC), 1 January 1970 (the unix epoch).

like image 65
Gaurav Mantri Avatar answered Oct 18 '25 18:10

Gaurav Mantri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!