O'Reilly logo

Guide to NoSQL with Azure Cosmos DB by Daron Yondem, Gaston C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading and updating an existing document with a dynamic object

Now we will write a method that updates the document that represents the second scheduled competition. Specifically, the method changes the values for the dateTime and numberOfRegisteredCompetitors keys.

At the time I was writing this book, the only way to update the value of any key in a document stored in a Cosmos DB collection was to replace the document with a new one. Since the first version of Cosmos DB and the SQL API, this is the only way to update the values for keys in a document. In this case, we just need to update the values for two keys, but we will have to replace the entire document.

The following lines declare the code for the UpdateScheduledCompetition asynchronous ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required