feat: auto-import schema files

This commit is contained in:
arashsheyda
2023-05-31 14:03:11 +03:00
parent cf48c2b6df
commit 205435e546
3 changed files with 33 additions and 4 deletions

View File

@ -36,10 +36,13 @@ export default defineNuxtConfig({
mongoose: {
uri: 'process.env.MONGODB_URI',
options: {},
modelsDir: 'models',
},
})
```
by default, `nuxt-mongoose` will auto-import your schemas from the `models` directory from `server` directory. You can change this behavior by setting the `modelsDir` option.
* for more information about the options, please refer to the [Mongoose documentation](https://mongoosejs.com/docs/connections.html#options). *
## API