This repo shows how to get started with the Azure Cosmos DB API for MongoDB API in a Python application.
-
The sample in the root directory, run.py, prompts you for connection information. This sample is written with separate functions for each operation as you might do in a production application. Try this sample to get started quickly.
-
The sample folders (e.g., 001-quickstart directory) contain runnable samples used in documentation quickstart and getting started guides. If you make changes here keep the documentation in sync.
The validate workflow is set up for pull requests. See the workflow for tests that are run and run those locally first.
Prerequisites:
- An Azure Cosmos DB API for MongoDB Account
- Python 3.8+ installed
- PyMongo installed
- python-dotenv installed to read the connection string from an .env file for all samples except the root directory sample.
Use python run.py
to run the code samples.
Make sure you define an .env variable with the connection string if needed for a sample.