A connection manager for Mongoose
Installation
The easiest way to install mongeese is through npm
:
$ npm i tylerdmace/mongeese
API
mongeese#connectionExists(name)
Checks for existing connection object.
Parameters
- name <String>
Returns
- <Bool>
mongeese#closeAllConnections()
Closes all connections.
Notes
Does not remove the connections from the pool; simply performs a disconnect() on the connection objects.
mongeese#closeConnection(name)
Closes a single connection.
Parameters
- name <String>
mongeese#createConnection(name)
Creates a new connection.
Parameters
- name <String>
Returns
- <Mongoose> this
mongeese#getAllConnections()
Gets all connection objects.
Returns
- <Object> connection pool
mongeese#getConnection(name)
Gets a single connection.
Parameters
- name <String>
Returns
- <Mongoose> this
mongeese#getConnectionCount()
Gets a count of all existing connections.
Returns
- <Number>
mongeese#removeAllConnections()
Removes all connection objects.
Notes
Does not close the connections; simply deletes the connection objects from the pool.
mongeese#removeConnection(name)
Removes a single connection.
Parameters
- name <String>
Returns
- <Bool>