O'Reilly logo

Learning Azure DocumentDB by Riccardo Becker

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

Updating documents

After executing some basic SELECT queries against our collection, it is time to do some updating. This means looking up the document, changing information, and saving it to the collection. Consider the following C# code snippet:

Updating documents

In the following code snippets, we will update a document, set a new date of birth, and save the document to the collection.

Note

To enable faster processing, we store the DateTime fields as epoch values so that range queries are executed efficiently.

I used information from the official Azure blogs (http://azure.microsoft.com/blog/2014/11/19/working-with-dates-in-azure-documentdb-4/) to create the following code snippet. Instead of comparing dates, the corresponding epoch values are compared ...

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