No suitable servers found on PHP Driver for MongoDB

This is my first time here… i started using MongoDB, I made a Cluster on Atlas cloud and integrated everything on my CodeIgniter Application.

I am using Official Driver of PHP for MongoDB to connect with cluster and do some operations.

Unfortunatly, When i try any Operation i always get error

No suitable servers found (serverSelectionTryOnce set): [Failed to resolve ‘’] | Mongodb::get | Query could not be executed

All my configuration is fine and i am using “STRING” type connection.

if i print $this->conn = new MongoDB\Driver\Manager($this->connString); it give me output like

[conn:Mongodb:private] => MongoDB\Driver\Manager Object
        [uri] => 
        [cluster] => Array


Composer install the MongoDB PHP Library, don’t use the PHP Extension Driver for MongoDB directly.

1 Like

I removed everything and reconfigured again same as you mentioned in link… and it worked …may be some extension /library issue… Thanks a lot sir…

1 Like