private function getConnectUri(\Phalcon\Config $config) {

        if($config->offsetExists('user') && $config->offsetExists('password')) {
            return "mongodb://".$config['user'].":".$config['password']."@".$config['host'].":".$config['port']."/".$config['dbname'];
        }
        else {
            return "mongodb://".$config['host'].":".$config['port']."/".$config['dbname'];
        }
    }