Skip to content

Instantly share code, notes, and snippets.

@vtemian
Created January 22, 2015 09:57
Show Gist options
  • Save vtemian/097c45433e2485d66a18 to your computer and use it in GitHub Desktop.
Save vtemian/097c45433e2485d66a18 to your computer and use it in GitHub Desktop.
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]
for collection in client.ReadCollections(db['_self']):
if collection['id'] == 'info':
for document in client.ReadDocuments(collection['_self']):
new_document = {key: value for key, value in document.iteritems() if not key.startswith("_")}
print new_document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment