Fix connection state and promise logic
Fix connection state and promise logic

Mongoose exposes `Connection#readyState` that can be used
to properly identify if there is a connection or not.
That is what should be used here.

gauthamchandra/apartment-hunter