Skip to content

Instantly share code, notes, and snippets.

@vtemian
Created January 16, 2015 14:04
Show Gist options
  • Save vtemian/2ffb783b552ca227562a to your computer and use it in GitHub Desktop.
Save vtemian/2ffb783b552ca227562a to your computer and use it in GitHub Desktop.
db01
import pydocumentdb.document_client as document_client
host = 'https://doc01.documents.azure.com'
masterKey = 'PhA7+FAD9uHw+McP/sM4CFZA4dUnOrzmgnk0J+SEcvOC5ac7UYNu/EHvOEBcOpEtj6Vz/YESDoxxxsnoaLDCGg=='
client = document_client.DocumentClient(host, {'masterKey': masterKey})
databases = client.ReadDatabases()
db = [db for db in databases if db['id'] == 'uvt01'][0]
print client.CreateCollection(db['_self'], {'Id': 'some_id', 'key': 'value'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment