You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (preg_match('/^mongodb:\\/\\/.+\\/([^?&]+)/s', $this->dsn, $matches)) {
The recommended protocol for connection DSNs in some cloud providers is: mongodb+srv
This is failing with an exception that a default database can not be found.
After setting the default database maually I am getting the following issue:
MongoDB\Driver\Exception\InvalidArgumentException: Failed to parse MongoDB URI: 'mongodb+srv://user:password@host/database'.
Invalid URI Schema, expecting 'mongodb://'. in /var/www/html/web/vendor/yiisoft/yii2-mongodb/src/Connection.php:356
I am considering this a bug, as the official MongoDB connection library supports this and it's highly logical for this to be a thin wrapper around it. See PHP example here:
Temporary workaround for anyone else experiencing this issue is to change it to: if (preg_match('/^mongodb(:|\+srv:)\\/\\/.+\\/([^?&]+)/s', $this->dsn, $matches)) {
yii2-mongodb/src/Connection.php
Line 203 in 837c14c
The recommended protocol for connection DSNs in some cloud providers is:
mongodb+srv
This is failing with an exception that a default database can not be found.
After setting the default database maually I am getting the following issue:
I am considering this a bug, as the official MongoDB connection library supports this and it's highly logical for this to be a thin wrapper around it. See PHP example here:
The text was updated successfully, but these errors were encountered: