Metadata-Version: 2.1
Name: cosmosdb-bulk-updater
Version: 0.5.0
Summary: A bulk updater for Microsoft CosmosDB
Home-page: https://github.com/renato04/cosmosdb-bulk-updater
Author: Renato Ramos
Author-email: ramos.renato@outlook.com
License: UNKNOWN
Description: # CosmosDB bulk updater
        
        A package to update a tons of documents in Microsoft CosmosDB
        
        **How it works?**
        
        It executes a query and iterate all the items executing an update function defined by the user. This query
        will be executed until it return any result
        
        **Usage**
        
        The sample bellow show how to add a new field into the all database documents
        
        ```python
        from cosmosdb_bulk_updater import BulkUpdater, Database
        
        
        def update_document(document: dict):
        
            document['new_field'] = 'blah'
            return document
        
        
        def run():
            database = Database(
                endpoint="[ENDPOINT]",
                key="[YOUR_KEY]",
                database="[DATABASE]",
                collection="[COLLECTION]"
            )
        
            updater = BulkUpdater(
                database=database,
                query="SELECT TOP 500 VALUE c FROM c where NOT IS_DEFINED(c.new_field)"
            )
        
            updater.execute_update(
                execute_fn=update_document
            )
        
        
        if __name__ == '__main__':
            run()
        
        ```
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
