Files
nuxt-mongoose/api/search

1 line
8.4 KiB
Plaintext

[{"id":"content:0.index.md","path":"/","dir":"","title":"Home","description":"","keywords":[],"body":" Nuxt Mongoose A Nuxt module for simplifying the use of Mongoose in your project. Elevate Your Developer Experience Nuxt DevTools Support Dive into your database with confidence. Benefit from Nuxt Devtools support, allowing you to inspect and debug your DB operations seamlessly. Auto Connection Forget about manual connection hassles. This module seamlessly handles the connection to your Mongoose database, making setup a breeze. Extendable & hackable This module grants you access to the full spectrum of Mongoose functionalities. Leverage the power of Mongoose in your project. \n .highlight {\n color: var(--color-primary-500);\n }\n\n .center {\n text-align: center;\n }\n .card svg {\n height: 3rem!important;\n width: 3rem!important;\n }\n .support {\n display: flex;\n justify-content: center;\n }\n"},{"id":"content:1.docs:1.getting-started:1.setup.md","path":"/docs/getting-started/setup","dir":"getting-started","title":"Setup","description":"A Nuxt module for simplifying the use of Mongoose in your project.","keywords":["Installation","Options"],"body":" Setup A Nuxt module for simplifying the use of Mongoose in your project. Installation Install nuxt-mongoose to your dependencies. pnpm add nuxt-mongoose -D\n npm install nuxt-mongoose -D\n yarn add nuxt-mongoose -D\n Add nuxt-mongoose to the modules section of your nuxt.config file. export default defineNuxtConfig ({\n modules: [\n 'nuxt-mongoose' ,\n ],\n })\n That's it! You can now use Mongoose in your Nuxt app ✨ Options You can configure the module by adding a mongoose section to your nuxt.config file.\nread more about Mongoose options . export default defineNuxtConfig ({\n mongoose: {\n // Options\n },\n })\n If you want to configure only the uri just add MONGODB_URI in your .env file. MONGODB_URI=YOUR_MONGO_URI\n html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}"},{"id":"content:1.docs:1.getting-started:2.configuration.md","path":"/docs/getting-started/configuration","dir":"getting-started","title":"Configuration","description":"Configure Nuxt Mongoose with the mongoose property.","keywords":[],"body":" Configuration Configure Nuxt Mongoose with the mongoose property. export default defineNuxtConfig ({\n mongoose: {\n uri: 'process.env.MONGODB_URI' ,\n options: {},\n modelsDir: 'models' ,\n devtools: true ,\n },\n })\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 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 html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}"},{"id":"content:1.docs:2.api:1.utils.md","path":"/docs/api/utils","dir":"api","title":"Utils","description":"Discover all available utils.","keywords":["defineMongooseModel","defineMongooseConnection"],"body":" Utils Discover all available utils. defineMongooseModel This function creates a new Mongoose model with schema. Example usage: export const User = defineMongooseModel ({\n name: 'User' ,\n schema: {\n email: {\n type: 'string' ,\n required: true ,\n unique: true ,\n },\n },\n options: {\n \n },\n hooks ( schema ) {\n \n },\n })\n import { defineMongooseModel } from '#nuxt/mongoose'\n \n export const User = defineMongooseModel ( 'User' , {\n email: {\n type: 'string' ,\n required: true ,\n unique: true ,\n },\n }, {\n \n }, ( schema ) => {\n \n })\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Key Type Require Description name string true Name of Model schema SchemaDefinition true Schema Definition of Model options SchemaOptions false Schema Options for Model hooks (schema: Schema<T>) => void false Schema Hooks Function to customize Model you can access the default connection with importing it from mongoose: import { connection } from 'mongoose'\n defineMongooseConnection This function creates a new Mongoose connection. nuxt-mongoose provides a default connection for you, it auto-register a plugin in nitro, so you don't need to use this function unless you want to create a new connection. more info here . Example usage: import { defineMongooseConnection } from '#nuxt/mongoose'\n \n export const connection = defineMongooseConnection ( 'mongodb://127.0.0.1/nuxt-mongoose' )\n html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}"},{"id":"content:1.docs:2.api:2.devtools.md","path":"/docs/api/devtools","dir":"api","title":"Devtools (beta)","description":"nuxt-mongoose comes with a Nuxt Devtools module that allows you to manage your collections and generate api-endpoints & schemas...","keywords":[],"body":" Devtools (beta) nuxt-mongoose comes with a Nuxt Devtools module that allows you to manage your collections and generate api-endpoints & schemas... Here is a demo video: "},{"id":"content:1.docs:2.api:3.examples.md","path":"/docs/api/examples","dir":"api","title":"Examples","description":"Here are a few examples:","keywords":[],"body":" Examples Here are a few examples: Nuxt Mongoose Minimal: Github Website"},{"id":"content:2.playground:1.index.md","path":"/playground","dir":"","title":"Playground","description":"","keywords":[],"body":" Playground "},{"id":"content:3.releases:index.md","path":"/releases","dir":"","title":"","description":"","keywords":[],"body":""}]