Connect rockat.chat mongo database using php script

Viewed 182

I needs to use the mongo database of Rocket chat 3.0.0 using php script remotely but its not working. here is my script

$manager = new MongoDB\Client(
  'mongodb://uname:password@Ip of server:port'
);
foreach ($manager->listDatabases() as $val){
  $db_array[] = $val->getName();
}

But it gives an error like :

Uncaught exception 'MongoDB\Driver\Exception\ConnectionTimeoutException' with message 'No suitable servers found (serverSelectionTryOnce set): [connection refused calling ismaster.

So can anyone let me know the solution that how can I access the meteor mongo database of Rocket chat

PHP version = 5.6

1 Answers

Do you can connect to this Mongodb with another way? Like a Robo3T ?

Related