title: Cosmos DB optimistic concurrency using MongoDB API
body: <p>We are using Cosmos DB via the Mongo API in a .net Core environment. Multiple clients can modify a single collection and we decided to use the optimistic concurrency model.</p>
  
  <p>From the docs <a href="https://codeopinion.com/documentdb-optimistic-concurrency/" rel="nofollow noreferrer">here</a> I know there is a build in ETAG field in a cosmos DB. The problem is that I have no idea how to retrieve this field using the MongoDB API. I am not even sure if I can access this field with this API.</p>
  
  <p>The alternative would be to implement a unique id field on my own but I'd rather prefer to use something in-build.</p>