Skip to content

This sample shows how to get started with the Azure Cosmos DB API for MongoDB API from a Python application

License

Notifications You must be signed in to change notification settings

Azure-Samples/azure-cosmos-db-mongodb-python-getting-started

Repository files navigation

Azure Cosmos DB API For MongoDB Python Quickstart and Getting Started Guides

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.

Sample prerequisites

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.

About

This sample shows how to get started with the Azure Cosmos DB API for MongoDB API from a Python application

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages