当前位置:网站首页>Mongoose - Why we make “mongoose.Promise = global.Promise” when setting a mongoose module?

Mongoose - Why we make “mongoose.Promise = global.Promise” when setting a mongoose module?

2022-06-26 02:24:00 Bustling city

problem :

I'm working with Mongoose. I am working with meerkats .I have seen a lot of developers make the following command: I've seen many developers issue the following commands :

mongoose.Promise = global.Promise;

Then I was curious to see what is the original value of mongoose.Promise . Then I looked at it curiously mongoose.Promise What is the original value of .I have entered in my editor the following command: I entered the following command in the editor :

const mongoose = require("mongoose");console.log("promise: ", mongoose.Promise);

My console returned me : My console returns to me :

promise: function Promise() { [native code] } 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 ? well , So why use commands mongoose.Promise = global.Promise because Mongoose Of mongoose.Promise = global.Promise Native code has been returned ?I don't understand the point, if someone can help us to understand, would be great, I don't understand that , If someone can help us understand , That would be great ,

Thanks thank you


Solution :

Reference resources : https://stackoom.com/en/question/3Vbp4
原网站

版权声明
本文为[Bustling city ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180549587602.html