e-oj / Fawn

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

Mongoose instance invalid !!! #94

Open kany187 opened 2 years ago

kany187 commented 2 years ago

Fawn is not working well with the new version of Mongoose (6.0.4). Getting error when using "Fawn.init(mongoose)". The new version of Mongoose implemented severals changes.

swagmadou commented 2 years ago

use this package --mongoose-transactions

shriyansnaik commented 2 years ago

As per the documentation, try using

var Fawn = require("fawn"); 
Fawn.init("mongodb://127.0.0.1:27017/yourDbName");

or

var mongoose = require("mongoose");
mongoose.connect("mongodb://127.0.0.1:27017/testDB");

Fawn.init(mongoose);

Fawn is not working well with the new version of Mongoose (6.0.4). Getting error when using "Fawn.init(mongoose)". The new version of Mongoose implemented severals changes.