Connecting to the mongodb atlas and trying to write a simple document gives the following error. What am I doing wrong?
$manager = new MongoDB\Driver\Manager("mongodb://admin:admin@test-shard-00-00-rbgc.mongodb.net:27017/db?ssl=false&replicaSet=test-shard-0&authSource=admin&serverSelectionTryOnce=false");
var_dump($manager);
$bulk = new MongoDB\Driver\BulkWrite;
$bulk->insert(['x' => 1]);
$manager->executeBulkWrite('db.collection', $bulk);
Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found: serverselectiontimeoutms timed out: [connection closed calling ismaster on 'test-shard-00-00-waf4c.mongodb.net:27017'] in /Applications/AMPPS/www/mongodb/liveserver.php:63
When I var_dump the $manager I get:
object(MongoDB\Driver\Manager)#1 (2) { ["uri"]=> string(64) "admin:admin@test-shard-00-00-rbgc.mongodb.net:27017/" ["cluster"]=> array(0) { } }