I'm working with Mongoose. I have seen a lot of developers make the following command:
mongoose.Promise = global.Promise;
Then I was curious to see what is the original value of mongoose.Promise
. I have entered in my editor the following command:
const mongoose = require(mongoose);
console.log(promise: , mongoose.Promise);
My console returned me :
promise: function Promise() { [native code] }
Okay, so why make the command mongoose.Promise = global.Promise
since the Mongoose's promise already returns a native code ? I don't understand the point, if someone can help us to understand, would be great,
Thanks