Skip to content

Instantly share code, notes, and snippets.

@dstarr
Last active March 7, 2018 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstarr/d6d7027de80cc7622ed91d896736d1be to your computer and use it in GitHub Desktop.
Save dstarr/d6d7027de80cc7622ed91d896736d1be to your computer and use it in GitHub Desktop.
Deleting all the files in the Azure Cosmos DB,
private async Task ModifyAllDocs()
{
List<SensorTick> docs = _client.CreateDocumentQuery<SensorTick>(_dbcUri).ToList();
foreach (var doc in docs)
{
doc.Temperature += 100;
Uri docUri = UriFactory.CreateDocumentUri(DbName, CollectionName, doc.Id);
await _client.ReplaceDocumentAsync(docUri.ToString(), doc);
Console.WriteLine(@"Updated: {0}", doc.Id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment