LearnBoost/mongoose — pull request #1926 by yorkie (2014-02-18 04:21:08+00:00)
Title: expose connection states for user-land

The below code just check a connection instance is connected
```js
var conn = mongoose.connection;
if (conn._readyState === 0) {
mongoose.connect('mongodb://localhost:27017/test');
}
```
but I prefer do this like:
```js
var conn = mongoose.connection;
if (conn._readyState === mongoose.STATES.disconnected
mongoose.connect('mongodb://localhost:27017/test');
}
```