From 89d50bd977de0f4edfdbe3ed150d0dca4d040709 Mon Sep 17 00:00:00 2001 From: Arash <38922203+arashsheyda@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:11:45 -0700 Subject: [PATCH] chore: update readme with documentation redirection --- README.md | 57 +------------------------------------------------------ 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/README.md b/README.md index cef379b..b648498 100644 --- a/README.md +++ b/README.md @@ -29,62 +29,7 @@ export default defineNuxtConfig({ ### Configuration -You can configure the module by adding a `mongoose` section to your `nuxt.config` file. - -```ts -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 - -### defineMongooseConnection - -This function creates a new Mongoose connection. Example usage: - -```ts -import { defineMongooseConnection } from '#nuxt/mongoose' - -export const connection = defineMongooseConnection('mongodb://127.0.0.1/nuxt-mongoose') -``` - -### defineMongooseModel - -This function creates a new Mongoose model with schema. Example usage: - -```ts -import { defineMongooseModel } from '#nuxt/mongoose' - -export const User = defineMongooseModel('User', { - name: { - type: String, - required: true, - }, -}) -``` - -**or you could use it like:** - -```ts -export const User = defineMongooseModel({ - name: 'User', - schema: { - name: { - type: String, - required: true, - }, - }, -}) -``` +For detailed [configuration](https://nuxt-mongoose.nuxt.space/docs/getting-started/configuration) and usage instructions, please refer to our [documentation](https://nuxt-mongoose.nuxt.space/). ## License