Giter Club home page Giter Club logo

atlas_starter_python's Introduction

MongoDB Atlas & pymongo Sample Project

This repository contains a very basic example application built with the pymongo MongoDB Driver that connects to MongoDB Atlas. You can use this application as a starting point and reference when building your Python applications.

Prerequisites

To build and run this project, you will need:

  • Python 3.7 or higher
  • The pymongo module
  • The dnspython module
  • An Atlas account

Getting Started

The following instructions explain how to get this project connected to your instance of MongoDB Atlas.

1. Download the Repository

To get started with this sample project, download this repository to your programming environment. You can clone this project using Git version control:

git clone [email protected]:mongodb-university/atlas_starter_python.git

Or you can download the ZIP archive using your browser. If you download this project as a ZIP archive, unzip the archive before proceeding.

2. Install the modules

You can use pip to install the necessary Python modules.

pip install pymongo dnspython

3. Configure your Atlas Credentials

  1. Open the atlas-starter.py file.

  2. On line 8, replace the placeholder text with the connection string to your Atlas cluster. For more information on finding your connection string, see the Atlas documentation.

    client = pymongo.MongoClient(
      "mongodb+srv://<username>:<password>@<cluster-name>/test?retryWrites=true&w=majority")

4. Run the program

  1. At your command prompt, navigate to the atlas_starter_python directory.

  2. Run the program:

python atlas-starter.py

Assuming you have the correct connection string, you'll see the program output. Have fun modifying the code to experiment with pymongo and MongoDB.

Troubleshooting

Are you having trouble getting connected to your MongoDB Atlas instance? Double-check the following:

  1. Have you replaced the placeholder text with a valid connection string provided by the Atlas UI? Read more here for further context.

  2. Have you whitelisted your current IP address in the Atlas UI?

atlas_starter_python's People

Contributors

steveren avatar nathan-contino-mongo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.