Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is modelsDir option needed? #43

Closed
vshulev opened this issue Feb 23, 2017 · 4 comments
Closed

Is modelsDir option needed? #43

vshulev opened this issue Feb 23, 2017 · 4 comments
Labels

Comments

@vshulev
Copy link

vshulev commented Feb 23, 2017

I noticed that there is no mention of modelsDir when I search the source code of the project. I am also seeing that there is a getModels function which actually gets the models from mongoose.models. So is modelsDir actually a required configuration option?

I am asking because our models are enclosed in functions like:

module.exports = function (app) {
    return new Schema({ ... })
}

and so we can't really pass a models folder to forest-express-mongoose without some build step first.

@arnaudbesnier
Copy link
Member

hi @vshulev, modelsDir is not a mandatory option. You're right, it is not explained anywhere in the documentation or during the onboarding steps.

Depending of your app implementation you will need it or not. If your models have already been required, before the liana integration call then it is not a necessary option.

Have fun using Forest!
🌲🌲🌲

@Christilut
Copy link

I'm using https://www.npmjs.com/package/@decorators/mongoose for my models and the modelsDir didn't work for that so I thought I was stuck until I saw this issue.
If modelsDir is optional, that should really be documented somewhere (preferably in the onboarding).

@arnaudbesnier
Copy link
Member

Hey @Christilut, I agree this should be documented.
But if you have an issue with modelsDir usage, this might be a bug, so feel free to create an issue on Github in this repo.

@Christilut
Copy link

Well I'm using the above decorators so I wasn't excepting forest to work out of the box with them. So I don't think that's a bug. I'm already glad to see that forest works with mongoose.models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants