Created
May 12, 2020 01:10
-
-
Save remster85/4785b2e8eb1adcbff475011e78a35085 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import azure.cosmos.cosmos_client as cosmos_client | |
import azure.cosmos.errors as errors | |
import azure.cosmos.http_constants as http_constants | |
import os | |
import json | |
url = 'https://remstrava.documents.azure.com:443/' | |
key = '' | |
client = cosmos_client.CosmosClient(url, {'masterKey': key}) | |
database_id = 'remstrava' | |
container_id = 'remstrava' | |
for item in client.QueryItems("dbs/" + database_id + "/colls/" + container_id, | |
'SELECT * FROM ' + container_id + ' ', | |
{'enableCrossPartitionQuery': True}): | |
item["athlete"] = "remster" | |
newItem = client.UpsertItem("dbs/" + database_id + "/colls/" + container_id, item) | |
print(json.dumps(newItem, indent=True)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment