I saw this question was asked once before but the answer did not help my situation.
I am a beginner software development student trying to connect Visual Studio Code to a newly created collection in MongoDB and display the collection, through a python file.
I'm sorry if that explanation doesn't use established terminology, I'm not entirely sure what I'm doing yet. I am using the code my professor provided and yet I get a whole host of syntax errors and a message that says there is no module named MongoClient. I am not allowed to use anything but VS Code so trying a different environment isn't an option. Here is my code:
Import MongoClient
from pymongo import MongoClient
url = “mongodb+srv://admin:admin@cluster0.zcfrz.mongodb.net/pytech?retryWrites=true”
client = MongoClient(url)
db = client.pytech
print(db.list_collection_names)
Any guidance would be truly appreciated.
