Mongoose: ".find(...).exec(...).then(...).catch(...).finally is not a function" using bluebird? Mongoose: ".find(...).exec(...).then(...).catch(...).finally is not a function" using bluebird? mongoose mongoose

Mongoose: ".find(...).exec(...).then(...).catch(...).finally is not a function" using bluebird?


And of course, after a few hours of struggle, I post on SO and find the answer :) Thanks to this answer by Anton Novik https://stackoverflow.com/a/42313136/8569785in another thread I've managed to plug bluebird.

It turns out that one of the files in the project had a

var mongoose = require('mongoose');mongoose.promise = require('bluebird');

Follow by another assignment a few lines later that had gone unnoticed:

mongoose.promise = global.Promise // Effectively assigning mongoose promise to the native implementation, oops ! 

After deleting the assignment, and making sure that every mongoose assignment is a local scope one, this is now resolved !