22 lines
949 B
Markdown
22 lines
949 B
Markdown
# Configuration
|
|
|
|
Configure Nuxt Mongoose with the `mongoose` property.
|
|
|
|
```ts [nuxt.config]
|
|
export default defineNuxtConfig({
|
|
mongoose: {
|
|
uri: 'process.env.MONGODB_URI',
|
|
options: {},
|
|
modelsDir: 'models',
|
|
devtools: true,
|
|
},
|
|
})
|
|
```
|
|
|
|
| **Key** | **Type** | **Default** | **Description** |
|
|
| ---------------------------- | ---------- | ----------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
| `uri` | `string` | process.env.MONGODB_URI | Connection Uri String |
|
|
| `options` | `ConnectOptions` | { } | Connection Options |
|
|
| `modelsDir` | `string` | models | The models(schema) directory located in `server` for auto-import |
|
|
| `devtools` | `boolean` | true | Enable Mongoose module in [`Nuxt Devtools`](https://github.com/nuxt/devtools) |
|