[Solved] MongoDB Insert Data Error: OperationFailure: Authentication failed…

pip uninstall pymongo
pip install pymongo==3.6

Enter the password
1. TypeError: ‘Collection’ object is not callable. If you meant to call the ‘authenticate’ method on a ‘Database’ object it is failing because no such method exists.

Can connect to its own mongodb database. I can but cannot insert data to the company server. You can insert data when running on someone else’s computer, so the key is your own environment. Either it is a mongodb version problem or a pymongo version problem.

ret = dbtable.insert_one(student)

2. OperationFailure: Authentication failed., Full error: {‘OK’: 0.0, ‘errmsg’: ‘authentication failed.’, ‘code’: 18, ‘codename’: ‘authenticationfailed.}
MongoDB inserts an error in data and authentication fails.

Solution:

Delete the latest version of pymongo. My MongoDB is also version 3.6

pip uninstall pymongo
pip install pymongo==3.6

Read More: