MongoDB.releaseConnection()

Release an active database connection.

Depending on the implementation of this driver, this might release the connection back into the pool or close it entirely. Regardless, if the provided connection has a transaction started, be sure to end the transaction by either committing it or rolling it back before releasing the connection.

Usage

Hover over inputs/exits for more info.

var MongoDB = require('machinepack-mongo');


// Release an active database connection.

MongoDB.releaseConnection({

connection: '===',

meta: '===',

}).execSync();

Inputs

connection required

An active database connection.

'==='
meta

Additional stuff to pass to the driver.

'==='

Exits

error

An unexpected error occurred.

badConnection

The provided connection is no longer active; or possibly never was.

'==='
success

OK.

'==='