My Mongo DB (using Azure Cosmos) reached max size of 20 GB. I didn’t realize that, and now the app is not working. We were planning to delete old records (last 2 years). However, there is no date field in the document. I was thinking if _ts is maintained internally but looks like it is not. Then the only options is to use the _id (which is ObjectId). Can someone help on how to delete based on a date range using c#?
2
Answers
I managed to make it work using this:
You can use
getTimestamp
methodIn the shell, you can find creation date by this:
C# code will look similar to: