e-oj / Fawn

Transactions for MongoDB (See the README)
https://www.npmjs.com/package/fawn
MIT License
486 stars 54 forks source link

Fix error with Fawn.init in mongoose ^6.0.5 #89

Open olalekanteeblaze opened 3 years ago

olalekanteeblaze commented 3 years ago

There's an issue with initializing Fawn in mongoose ^6.0.5. This comes from the isMongoose function. the modelSchemas object of the mongoose instance has been replaced with Schema from the recent version of mongoose. So this leads to the function returning false even when the mongoose instance is valid

EmmanDizon commented 3 years ago

Thankyou for this "&& (obj.modelSchemas || obj.Schema)" it work for me :)