The connection to mongo in the bootstrap is:
$di->set('mongo', function() {
$config = Registry::get(CONFIG);
$connect = array('username' => $config->mongo->username,
'password' => $config->mongo->password );
$mongo = new Mongo($config->mongo->host, $connect);
return $mongo->selectDb($config->mongo->name);
}, TRUE);
$di->set('collectionManager', '\Phalcon\Mvc\Collection');
In the controller I've tried
$user = User::find();
which shows: Fatal error: Phalcon\DI::get(): Maximum recursion depth exceeded
$user = new User();
Which shows the error: Fatal error: Phalcon\DI\Service::resolve(): Maximum recursion depth exceeded
The User model is simply
class User extends \Phalcon\Mvc\Collection
{
}