I was connecting the Python to mongoDB cluster.
But I got the error message 'importError: cannot import name 'MutableMapping' from 'collections' in Python. I want to know how to solve this problem.
Here is my code
from pymongo import MongoClient
client = MongoClient('mongodb+srv://sparta:test@cluster0.59qgozp.mongodb.net/?retryWrites=true&w=majority')
db = client.PYTHON
doc = {
'name':'Kevin',
'age':24
} db.user.insert_many(doc)
I tried to change db.user.insert_one to db.user.insert_many but both of them didn't work. And I also tried to use Python 3.8.6 since I am using the 3.11.4.