Hi, I am installing mongodb on Ubuntu22(ec2) using ansible but getting error:
TASK [realtimedb : create mongodb admin user] *******************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: ‘Collection’ object is not callable. If you meant to call the ‘add_user’ method on a ‘Database’ object it is failing because no such method exists.
mongodb ver: 7.0.3
pymongo ver: 4.6
Ubuntu22 supports min version 6 and I tested that as well.With min pymongo version 4.4 (all features supported) it returns the same error. I know that add_user and authenticate methods were deprecated in previous versions but could you please help if there is any fix for this issue or workaround?