Brief overview of Azure DocumentDB Document Properties

When you create a document in Azure DocumentDB, regardless of properties in the document, Azure creates and populates some default properties behind the scene for the document. Here is a brief overview of document properties:

_RID: Indicates unique resource identifier. Each document in Azure DocumentDB must have a unique string identifier (across the collection) which can be changed over the time and is specified in the document; However, _RID is generated by Azure and cannot be changed over the time.

_TS: Indicates the last time when document gets modified. Azure updates the value when you modify the document.  This can be very useful for  your application to get latest changes and updates after specific date.

_SELF: Unique addressable URI of the resource. Here is an example of the _SELF link:
dbs/DppTAA==/colls/DppTAvdAA=/docs/DppTAMYvdAABAAAAAAA==/
As you can see it starts with dbs and database Resource ID and then Colls and the collection Resource ID and finally docs and the document _RID identifier.

_ETAG: _ETAGs are used by Azure to manage optimistic concurrency and avoid users override each others’ changes. Stas Kondratyev posted a comprehensive article about _ETAGS here.

_ATTACHMENTS: Indicates path to the document’s attachment.

How to get Document Properties ?

To get the document properties, you need to select the document you want from the collection and then click on Properties icon on Document blade and you can get all the properties in Properties blade.

Azure_DocumentDB-File-Properties_01

Leave a Reply

Your email address will not be published. Required fields are marked *