We are in the process of updating our API's MongoDB hosting provider from mLab to MongoDB Atlas.
I have updated our connection server to PHP 7.4 with MongoDB PHP extension 1.7.4.
I have updated our API framework from Apigility to Laminas API Tools using the DoctrineMongoODMModule
I can successfully connect using the mongo shell using the following syntax:
mongo "mongodb+srv://test-server-dbteb.mongodb.net/<dbname>" --username <username>
I have looked far and wide to find a sample configuration of the DoctrineMongoODMModule with it's configuration file to connect to a MongoDB Atlas replica set using the mongo+srv:// protocol with no success to this point. Currently the errors are Failed to parse MongoDB URI.
If anyone has had a similar experience, any help would be greatly appreciated.
I had the same issue and im still looking forward to get a real solution.
I directly edited the ConnectionFactory.php in the doctrine-mongo-odm-module (src/DoctrineMongoODMModule/Service/ConnectionFactory.php) with the following code
and in my connection file:
I think this is the worst possible solution (editing vendor' files) but in my case worked, take that as a temporary fix