lawrencegripper / ion

MIT License
12 stars 6 forks source link

Add timetamps to all document types #161

Open jjcollinge opened 6 years ago

jjcollinge commented 6 years ago

Currently, we do not add any timestamps to the documents stored in the document store.

lawrencegripper commented 6 years ago

Might be worth going down the unix approach for cosmos as it avoids the need to enable range queries on strings

Alternatively, you can store DateTimes as Unix timestamps, that is, as a number representing the number of elapsed seconds since January 1, 1970. Azure Cosmos DB's internal Timestamp (_ts) property follows this approach. You can use the UnixDateTimeConverter class to serialize DateTimes as numbers.

https://docs.microsoft.com/en-us/azure/cosmos-db/working-with-dates#indexing-datetimes-for-range-queries