This sample notebook demonstrates how to implement optimistic concurrency using ETags in Azure Cosmos DB with Python.
- π Open
etag_cosmos.ipynb
in VS Code or Jupyter. βΆοΈ Run cells sequentially to:- Connect to Cosmos DB
- Read items and fetch their ETags
- Upsert a test document
- Perform conditional updates using the ETag
- Demonstrate success and failure cases
- Clean up test items