Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!