title: Mongodb "auth fails" with mongodb php driver and new php library
body: <p>Using the new mongodb driver: <a href="https://github.com/mongodb/mongo-php-driver" rel="nofollow noreferrer">https://github.com/mongodb/mongo-php-driver</a> and the new php library for it: <a href="https://github.com/mongodb/mongo-php-library" rel="nofollow noreferrer">https://github.com/mongodb/mongo-php-library</a> I am getting "auth fails" trying to perform a simple find() query.</p>
  
  <p>In the following code, the connection string follows the pattern mongodb://user:password@mongoinstance:port/database. The connection string works with find() using the old legacy mongo driver, but not the new mongodb driver. The new mongodb is correctly installed in php and displays in phpinfo, the only breaking change we needed to make was to use "new MongoDB\Client" instead of new MongoClient for the legacy mongo driver.</p>
  
  <p><a href="https://i.stack.imgur.com/xPNsi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xPNsi.png" alt="mongo connection code"></a></p>
  
  <p>However, when I try to run the following find(), I get auth fails exception in vendor/mongodb/mongodb/src/Operation/Find.php line 179</p>
  
  <p><a href="https://i.stack.imgur.com/4pkmi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4pkmi.png" alt="mongo find()"></a></p>
  
  <p>Using legacy mongo driver there are no problems. Any ideas on the auth fails? What is the mongodb driver failing on exactly? Correct credentials for database and collection are being passed in the mongodb://string. Works in legacy fails with new driver and library.</p>
  
  <p><strong>Environment:</strong></p>
  
  <ul>
  <li>Windows 10</li>
  <li>Wamp</li>
  <li>PHP 5.5.12</li>
  <li>Mongodb driver 1.1.4</li>
  <li>Latest version of new php library (Installed with composer: composer require "mongodb/mongodb=^1.0.0")</li>
  <li>Mongo instance version 2.4.6</li>
  </ul>