tungus
tungus copied to clipboard
autoIndex error with tungus and mongoose ~V4
We got the message error when we executed the example script with mongoose v4.0.2
/node_modules/mongoose/lib/model.js:800
(this.schema.options.autoIndex === null && this.db.config.autoIndex)) {
^
TypeError: Cannot read property 'autoIndex' of undefined
at Function.init (/Users/suppanathuss/Desktop/Test/node_modules/mongoose/lib/model.js:800:64)
at Mongoose.model (/Users/suppanathuss/Desktop/Test/node_modules/mongoose/lib/index.js:376:11)
at Object.<anonymous> (/Users/suppanathuss/Desktop/Test/test.js:16:24)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Happens also with Mongoose 3.9.7, but not with 3.8.22
Same here, works in 3.8.22, not in 4.0.4
Mongoose 4.x uses mongodb driver 2.x which has sensitive amount changes for API and untill TingoDB will get 2.x API compatibility module we'll not be able to support Mongoose 4.x
A workaround is to add a config
object field in connections, see
https://github.com/sergeyksv/tungus/compare/master...muka:master
Best