Rapidfacture / mongoose-multi

NPM Module: Create Mongoose connections to severals DBs; short, mongoDB like syntax for requests.
12 stars 4 forks source link

Updates to mongoose 5.1.1. Corrects readme.md #4

Closed gofreddo closed 6 years ago

gofreddo commented 6 years ago

I updated the Mongoose version.

We found the readme had errors. When you pass in a string to mongooseMulti.start it does a require that is relative to ./node_modules/mongoose-multi and can't find your path. Using mongooseMulti.start(dbConfig, node.env.PWD + './schemas.js'); corrects this issue.

Also dbConfig wants an object like: { "application": 'mongodb://localhost:27017/application', "book": 'mongodb://localhost:27017/books' }

Your Network config file example exports { "db":{ "application": 'mongodb://localhost:27017/application', "book": 'mongodb://localhost:27017/books' } }

Either it should skip the "db": and just export the correct object or dbConfig = require('./config.js') should be dbConfig = require('./config.js').db

Thanks for the repo though. Other than those issues it is working great.

FelixFurtmayr commented 6 years ago

Hi Jeff,

thanks for correcting the readme :-) Also you updated the mongoose version. I will accept the pull and update the npm version to 0.4.0 because of the mongoose version change.

Regards Felix

gofreddo commented 6 years ago

thanks

FelixFurtmayr commented 6 years ago

new version is online on npm

gofreddo commented 6 years ago

awesome thanks.