egg-mongoose
egg-mongoose copied to clipboard
feat: support putting the `model` files to the designated path and the customized delegate name to the `Context`
Checklist
- [x]
npm testpasses - [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message follows commit guidelines
Affected core subsystem(s)
Don't affect the previous functions and config ways.
Description of change
The reason of why
Sometimes, the developers need to add multi and different databases(SQL and NoSQL) in one project.
For my personal experience, I use MySQL as my defaulted database, the models of MySQL is placed on app/model. After the project is done for the period, I need to get the data from the company's MongoDB. However, both the defaulted path location app/model and delegate ctx.model in Context are used by the previous MySQL. I found the egg-mongoose don't support the features by the developers' needs. So I work on it and add the new features with the previous features and settings.
The new supported features
- [x] support customizing the model folder path, the default is under
app/model - [x] support renaming the delegate in
Context, the default isapp.model