Promises with the MongoDB Node client

Now with Bluebird.js disposers!

Thomas A. Valletta
1 min readJun 15, 2016

The MongoDB node client is more flexible than many people know. It will return a promise if the callback parameter is omitted. For example:

MongoDB uses es6-promise to implement promises. This allows them to be as spec compliant as is currently possible.

If you are a fan of Bluebird.js and think that Bluebird style disposers would simplify your MongoDB connections, that can be easily accomplished as well.

--

--

Thomas A. Valletta

Web Platform Sympathizer. No post reflecting my political, social, ethical or zoological leanings. Just development related trumpery.