Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the instructions below because when I type this command in Visual Studio Code from pymongo import MongoClient it says pymngo is

I need help with the instructions below because when I type this command in Visual Studio Code "from pymongo import MongoClient" it says pymngo is not defined.

Can you tell me what I am doing wrong because I have re-installed pymongo and it still shows the same error. Please tell me what i'm doing wrong and how to fix this issue.

  • Sign-in to MongoDB Atlas, select the CONNECTION button, and copy the connection string for connecting an application.
  • Import MongoClient
    • from pymongo import MongoClient
  • Create a variable named url and assign it the connection string value you copied from MongoDB Atlas.
    • url = ;
  • Create a variable named client and call the MongoClient passing-in the url variable.
    • client = MongoClient(url)
  • Create a variable named db and assign it to the pytech database instance.
    • db = client.pytech
  • Using Pythons built-in print statement, calling the list_collection_names method off of the db variable.
    • print(db.list_collection_names)
  • Open a terminal window inside of VS Code.
    • Terminal > New Terminal
  • Under the Problems tab there will be a listing of any Python errors. Make sure you correct these before turning in your work.
  • Select the Terminal tab and run the program by selecting Run > Start Debugging
  • Continue to run and test the program until there are no errors and you can see the students collection in the terminal window.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

2. Define communication.

Answered: 1 week ago