Cluster mongo Db Not Connecting in php

 require_once 'vendor/autoload.php';
 $con = new MongoDB\Client("mongodb://,,");
 $db = $con->selectDatabase('test');  
 $col = $db->selectCollection('user');
 $sql = $col->find();
 foreach($sql as $cols)

But it shows this error. Pls, help me to solve it.

Hi @singa_raj,

Welcome to the community :slight_smile:

I cannot see that you have posted any error unless I have missed it. Can you provide the following information:

  1. The full error message
  2. If you’ve been able to connect previously
  3. Driver version
  4. (Optional but could help with troubleshooting) - If you have attempted to connect from the same client using mongosh or MongoDB Compass (you’ll need to select Deployment Type: cloud and Client: shell or Client: compass for the corresponding connection guides).