Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started