Created
January 22, 2015 09:57
-
-
Save vtemian/097c45433e2485d66a18 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 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