我想将 Laravel 与 AWS 的 DocumentDB 连接起来。但我找不到任何关于此的文档或教程。有没有办法将 DocumentDB 至少连接到 Laravel 服务器?
问问题
944 次
1 回答
1
The documentation provided in AWS docs [for php] didn't work for me, the below connection uri works.
$dbUri = "mongodb://$user:$pass@$host:$port/$db?retryWrites=true&w=majority&authSource=admin
&ssl=true&sslcertificateauthorityfile=$sslFilePath/rds-combined-ca-bundle.pem";
$client = new MongoDB\Client($dbUri,['readPreference' => 'secondaryPreferred']);
于 2021-02-09T08:41:11.937 回答