title: What settings should I use for db if I only want to use MongoDB in PhalconPHP?
body: <p>I created a simple Phalcon project using Phalcon DevTools (1.2.3).
  Now I want to use MongoDB for the database. How do I set this up correctly?
  I came this far (see code below):</p>
  
  <h3>This is my config.php</h3>
  
  <pre><code>&lt;?php
  
  return new \Phalcon\Config(array(
  'database' =&gt; array(
      'adapter'     =&gt; 'Nosql', //Was 'Mysql', but Nosql is not supported?
      'host'        =&gt; 'localhost',
      'username'    =&gt; 'root',
      'password'    =&gt; '',
      'dbname'      =&gt; 'test',
  ),
  'application' =&gt; array(
      'controllersDir' =&gt; __DIR__ . '/../../app/controllers/',
      'modelsDir'      =&gt; __DIR__ . '/../../app/models/',
      'viewsDir'       =&gt; __DIR__ . '/../../app/views/',
      'pluginsDir'     =&gt; __DIR__ . '/../../app/plugins/',
      'libraryDir'     =&gt; __DIR__ . '/../../app/library/',
      'cacheDir'       =&gt; __DIR__ . '/../../app/cache/',
      'baseUri'        =&gt; 'localhost/',
  )
  ));
  </code></pre>
  
  <h3>This is my services.php</h3>
  
  <pre><code>&lt;?php    
  
  use Phalcon\DI\FactoryDefault,
  Phalcon\Mvc\View,
  Phalcon\Mvc\Url as UrlResolver,
  //Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter, //Do I need this when I use Mongo?
  Phalcon\Mvc\View\Engine\Volt as VoltEngine,
  Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter,
  Phalcon\Session\Adapter\Files as SessionAdapter;
  
  /**
   * The FactoryDefault Dependency Injector automatically register the right services  providing a full stack framework
   */
  $di = new FactoryDefault();
  
  /**
   * The URL component is used to generate all kind of urls in the application
   */
  $di-&gt;set('url', function() use ($config) {
      $url = new UrlResolver();
      $url-&gt;setBaseUri($config-&gt;application-&gt;baseUri);
      return $url;
  }, true);
  
  /**
   * Setting up the view component
   */
  $di-&gt;set('view', function() use ($config) {
  
  $view = new View();
  
  $view-&gt;setViewsDir($config-&gt;application-&gt;viewsDir);
  
  $view-&gt;registerEngines(array(
      '.volt' =&gt; function($view, $di) use ($config) {
  
          $volt = new VoltEngine($view, $di);
  
          $volt-&gt;setOptions(array(
              'compiledPath' =&gt; $config-&gt;application-&gt;cacheDir,
              'compiledSeparator' =&gt; '_'
          ));
  
          return $volt;
      },
      '.phtml' =&gt; 'Phalcon\Mvc\View\Engine\Php'
  ));
  
  return $view;
  }, true);
  
  /**
   * Database connection is created based in the parameters defined in the configuration file
   */
  $di-&gt;set('mongo', function() use ($config) {
      $mongo = new Mongo();
      return $mongo-&gt;selectDb($config-&gt;database-&gt;dbname);
  });
  
  /**
   * If the configuration specify the use of metadata adapter use it or use memory otherwise
   */
  $di-&gt;set('modelsMetadata', function() {
      return new MetaDataAdapter();
  });
  
  /**
   * Start the session the first time some component request the session service
   */
  $di-&gt;set('session', function() {
      $session = new SessionAdapter();
      $session-&gt;start();
      return $session;
  });
  </code></pre>
  
  <p>I altered the standard mysql db connection to be mongo, using the documentation.
  But now I have to set up my database adapter in Config, but Nosql doesn't seem to work. DevTools throws this error in the terminal when trying to create a model: </p>
  
  <pre><code>Error: Adapter Nosql is not supported
  </code></pre>
  
  <p>When I do put in ' Mysql' for the adapter in the config and try to create a model, this is the error I get:</p>
  
  <pre><code>Error: SQLSTATE[HY000] [2002] No such file or directory
  </code></pre>
  
  <p>Does it need the Mysql adapter to be set in order to use Mongo/Nosql? Or should I put in something else for the adapter/config? Any ideas? </p>