So in the event that a port isn't added (because it doesn't need to be for the [short form](http://docs.mongodb.org/manual/reference/connection-string/)) we should provide the default:

```php
$url_parts = parse_url($this->config['connections']['mongo']);
$port = isset($url_parts['port']) ? $url_parts['port'] : 27017;
$cmd = 'mongo -u ' . $url_parts['user'] . ' -p ' . $url_parts['pass'] . ' --port ' . $url_parts['port'] . ' ' . ltrim($url_parts['path'], '/');
```

Unless the command line is smart enough to ignore a blank port... Sorry for not being clearer about this.