tungus icon indicating copy to clipboard operation
tungus copied to clipboard

autoIndex error with tungus and mongoose ~V4

Open thakerng opened this issue 9 years ago • 4 comments

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

thakerng avatar Apr 28 '15 10:04 thakerng

Happens also with Mongoose 3.9.7, but not with 3.8.22

ItsCosmo avatar May 07 '15 18:05 ItsCosmo

Same here, works in 3.8.22, not in 4.0.4

ChrisTerBeke avatar May 29 '15 11:05 ChrisTerBeke

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

sergeyksv avatar Sep 14 '15 20:09 sergeyksv

A workaround is to add a config object field in connections, see

https://github.com/sergeyksv/tungus/compare/master...muka:master

Best

muka avatar Sep 18 '15 16:09 muka