Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How _ts change in DocumentDB

I have a question regarding the _ts field within the documentdb. How is it determined? My understanding is that when a document is added/altered it gets a new _ts. Are there any chance that two documents have the same _ts? If so, does it happen only if those documents are added at the exact time (in terms of milli second).

like image 485
HHH Avatar asked Dec 15 '15 20:12

HHH


People also ask

What is _TS in Cosmos DB?

Items in Cosmos DB have a _ts system property. The _ts value is an epoch value in seconds (not milliseconds) since an item was last modified. To convert the _ts value from seconds to milliseconds or 100-nanosecond ticks, simply multiply by 1,000 or 10,000,000, respectively.

Is Cosmos DB a DocumentDB?

Azure Cosmos DB is the next big leap in globally distributed, at scale, cloud databases. As a DocumentDB customer, you now have access to the new breakthrough system and capabilities offered by Azure Cosmos DB.

Can Azure functions access DocumentDB?

There are two ways you can connect to documentDB from an Azure function. DocumentClient documentClient = new DocumentClient( "SERVICE_ENDPOINT", "MASTER_KEY", ConnectionPolicy. GetDefault(), ConsistencyLevel. Session);


1 Answers

_ts is a system property denoting when a document was last updated (e.g. create or replace).

_ts is represented as a POSIX or epoch time value. In other words, its the number of seconds (not milliseconds) that have elapsed since 00:00:00 (UTC), 1 January 1970.

It is possible to have the same _ts value across multiple documents when there are multiple documents written/updated during the same second.

like image 149
Andrew Liu Avatar answered Sep 22 '22 14:09

Andrew Liu