Hi,
I just noticed that you put "mongoose: *" into the package.json, which will lead to getting unstable versions for Mongoose on an "npm update". This would be fine, by itself, but problems occur when you create the Schema instance with a differnet Mongoose version than the one used for the database connection.
Here's where it breaks:
/node_modules/mongoose/lib/schema.js:362
throw new TypeError('Undefined type at `' + path +
^
TypeError: Undefined type at `paths.sid`
Did you try nesting Schemas? You can only nest using refs or arrays.
at Function.Schema.interpretAsType (/node_modules/mongoose/lib/schema.js:362:11)
at Schema.path (/node_modules/mongoose/lib/schema.js:305:29)
at Schema.add (/node_modules/mongoose/lib/schema.js:217:12)
at Schema.add (/node_modules/mongoose/lib/schema.js:212:14)
at new Schema (/node_modules/mongoose/lib/schema.js:73:10)
at NativeConnection.Connection.model (/node_modules/mongoose/lib/connection.js:584:14)
at new SessionStore (/node_modules/session-mongoose/index.js:95:35)
at Object.<anonymous> (/app.js:51:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
Suggested solution: if a connection is passed through the options parameter, you should use the Schema class from that connection, rather than the one from your own Mongoose version, to avoid conflicts.
Cheers,
Steffen
Hi,
I just noticed that you put "mongoose: *" into the package.json, which will lead to getting unstable versions for Mongoose on an "npm update". This would be fine, by itself, but problems occur when you create the Schema instance with a differnet Mongoose version than the one used for the database connection.
Here's where it breaks:
And that's where things break:
Suggested solution: if a
connectionis passed through the options parameter, you should use the Schema class from that connection, rather than the one from your own Mongoose version, to avoid conflicts.Cheers,
Steffen