title: How to get all Collection Names in mongodb with PHP
body: <p>Something is wrong with my code, because I get a fatal error when I try to call to method <code>getCollectionNames()</code>.</p>
  
  <p><code>listCollections()</code> works perfectly.</p>
  
  <p>This is my code.</p>
  
  <pre><code>require '../vendor/autoload.php';
  $client = new MongoDB\client;
  $database = $client-&gt;test;
  $colections = $database-&gt;getCollectionNames();
  
  foreach ($colections as $col) {
      var_dump($col);
  }
  </code></pre>
  
  <p>...and this is the error.</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Call to undefined method
    MongoDB\Database::getCollectionNames() in
    (some route) Stack trace: #0
    {main} thrown in (some route) on
    line (some line)</p>
  </blockquote>
  
  <p>Does anyone know what I am doing wrong?</p>