Files
nuxt-mongoose/api/_content/cache.1689600000014.json

1 line
43 KiB
JSON

{"generatedAt":1689600038172,"generateTime":2473,"contents":[{"_path":"/","_dir":"","_draft":false,"_partial":false,"_locale":"","_empty":false,"title":"Home","description":"","navigation":false,"layout":"page","main":{"fluid":false},"body":{"type":"root","children":[{"type":"element","tag":"ellipsis","props":{"blur":"150px","right":"0px","width":"75%"},"children":[]},{"type":"element","tag":"block-hero","props":{":cta":"[\"Get started\",\"/getting-started/setup\"]",":secondary":"[\"Open on GitHub →\",\"https://github.com/arashsheyda/nuxt-mongoose\"]"},"children":[{"type":"element","tag":"template","props":{"v-slot:title":""},"children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Nuxt "},{"type":"element","tag":"span","props":{"style":"color: var(--color-primary-500)"},"children":[{"type":"text","value":"Mongoose"}]}]}]},{"type":"element","tag":"template","props":{"v-slot:description":""},"children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A Nuxt module for simplifying the use of "},{"type":"element","tag":"a","props":{"href":"https://mongoosejs.com/","rel":["nofollow"]},"children":[{"type":"text","value":"Mongoose"}]},{"type":"text","value":" in your project."}]}]},{"type":"element","tag":"template","props":{"v-slot:support":""},"children":[{"type":"element","tag":"terminal","props":{":content":"[\"npm i nuxt-mongoose -D\"]"},"children":[]}]}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:0.index.md","_source":"content","_file":"0.index.md","_extension":"md"},{"_path":"/getting-started/_dir","_dir":"getting-started","_draft":false,"_partial":true,"_locale":"","icon":"tabler:brand-mongodb","navigation":{"redirect":"/getting-started/setup"},"_id":"content:1.getting-started:_dir.yml","_type":"yaml","title":"Dir","_source":"content","_file":"1.getting-started/_dir.yml","_extension":"yml"},{"_path":"/getting-started/setup","_dir":"getting-started","_draft":false,"_partial":false,"_locale":"","_empty":false,"title":"Setup","description":"A Nuxt module for simplifying the use of Mongoose in your project.","body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"setup"},"children":[{"type":"text","value":"Setup"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A Nuxt module for simplifying the use of Mongoose in your project."}]},{"type":"element","tag":"h2","props":{"id":"installation"},"children":[{"type":"text","value":"Installation"}]},{"type":"element","tag":"ol","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Install "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"text","value":" to your dependencies."}]}]},{"type":"element","tag":"code-group","props":{},"children":[{"type":"element","tag":"code","props":{"className":["language-bash"],"code":"pnpm add nuxt-mongoose -D\n","filename":"pnpm","language":"bash","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"pnpm"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"add"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"-D"}]}]}]}]}]},{"type":"element","tag":"code","props":{"className":["language-bash"],"code":"npm install nuxt-mongoose -D\n","filename":"npm","language":"bash","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"npm"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"install"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"-D"}]}]}]}]}]},{"type":"element","tag":"code","props":{"className":["language-bash"],"code":"yarn add nuxt-mongoose -D\n","filename":"yarn","language":"bash","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"yarn"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"add"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"-D"}]}]}]}]}]}]},{"type":"element","tag":"ol","props":{"start":2},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Add "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"text","value":" to the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"modules"}]},{"type":"text","value":" section of your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt.config"}]},{"type":"text","value":" file."}]}]},{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"export default defineNuxtConfig({\n modules: [\n 'nuxt-mongoose',\n ],\n})\n","filename":"nuxt.config","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineNuxtConfig"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"({\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"modules: [\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'nuxt-mongoose'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":4},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" ]"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":5},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"})"}]}]}]}]}]},{"type":"element","tag":"alert","props":{"type":"success"},"children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"That's it! You can now use Mongoose in your Nuxt app ✨"}]}]},{"type":"element","tag":"h2","props":{"id":"options"},"children":[{"type":"text","value":"Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can configure the module by adding a "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"mongoose"}]},{"type":"text","value":" section to your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt.config"}]},{"type":"text","value":" file.\nread more about "},{"type":"element","tag":"a","props":{"href":"/getting-started/configuration"},"children":[{"type":"text","value":"Mongoose options"}]},{"type":"text","value":"."}]},{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"export default defineNuxtConfig({\n mongoose: {\n // Options\n },\n})\n","filename":"nuxt.config","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineNuxtConfig"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"({\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"mongoose: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-128513"},"children":[{"type":"text","value":"// Options\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":4},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" }"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":5},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"})"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to configure only the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"uri"}]},{"type":"text","value":" just add "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"MONGODB_URI"}]},{"type":"text","value":" in your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".env"}]},{"type":"text","value":" file."}]},{"type":"element","tag":"code","props":{"className":["language-env"],"code":"MONGODB_URI=YOUR_MONGO_URI\n","language":"env","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{},"children":[{"type":"text","value":"MONGODB_URI=YOUR_MONGO_URI"}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".dark .ct-443230{color:#FFA657;}\n.ct-443230{color:#953800;}\n.dark .ct-935781{color:#C9D1D9;}\n.ct-935781{color:#24292F;}\n.dark .ct-667011{color:#A5D6FF;}\n.ct-667011{color:#0A3069;}\n.dark .ct-998471{color:#79C0FF;}\n.ct-998471{color:#0550AE;}\n.dark .ct-942366{color:#FF7B72;}\n.ct-942366{color:#CF222E;}\n.dark .ct-923966{color:#D2A8FF;}\n.ct-923966{color:#8250DF;}\n.dark .ct-128513{color:#8B949E;}\n.ct-128513{color:#6E7781;}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"installation","depth":2,"text":"Installation"},{"id":"options","depth":2,"text":"Options"}]}},"_type":"markdown","_id":"content:1.getting-started:1.setup.md","_source":"content","_file":"1.getting-started/1.setup.md","_extension":"md"},{"_path":"/getting-started/configuration","_dir":"getting-started","_draft":false,"_partial":false,"_locale":"","_empty":false,"title":"Configuration","description":"Configure Nuxt Mongoose with the mongoose property.","body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"configuration"},"children":[{"type":"text","value":"Configuration"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Configure Nuxt Mongoose with the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"mongoose"}]},{"type":"text","value":" property."}]},{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"export default defineNuxtConfig({\n mongoose: {\n uri: 'process.env.MONGODB_URI',\n options: {},\n modelsDir: 'models',\n devtools: true,\n },\n})\n","filename":"nuxt.config","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineNuxtConfig"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"({\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"mongoose: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" uri: "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'process.env.MONGODB_URI'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":4},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" options: {},\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":5},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" modelsDir: "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'models'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":6},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" devtools: "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":7},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" }"}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":8},"children":[{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"})"}]}]}]}]}]},{"type":"element","tag":"table","props":{},"children":[{"type":"element","tag":"thead","props":{},"children":[{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Key"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Type"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Default"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Description"}]}]}]}]},{"type":"element","tag":"tbody","props":{},"children":[{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"uri"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"process.env.MONGODB_URI"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Connection Uri String"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"options"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"ConnectOptions"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"{ }"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Connection Options"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"modelsDir"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"models"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"The models(schema) directory located in "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"server"}]},{"type":"text","value":" for auto-import"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"devtools"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"boolean"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Enable Mongoose module in "},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxt/devtools","rel":["nofollow"]},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Nuxt Devtools"}]}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".dark .ct-942366{color:#FF7B72;}\n.ct-942366{color:#CF222E;}\n.dark .ct-443230{color:#FFA657;}\n.ct-443230{color:#953800;}\n.dark .ct-923966{color:#D2A8FF;}\n.ct-923966{color:#8250DF;}\n.dark .ct-935781{color:#C9D1D9;}\n.ct-935781{color:#24292F;}\n.dark .ct-667011{color:#A5D6FF;}\n.ct-667011{color:#0A3069;}\n.dark .ct-998471{color:#79C0FF;}\n.ct-998471{color:#0550AE;}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:1.getting-started:3.configuration.md","_source":"content","_file":"1.getting-started/3.configuration.md","_extension":"md"},{"_path":"/api/_dir","_dir":"api","_draft":false,"_partial":true,"_locale":"","title":"API","icon":"tabler:book","_id":"content:2.api:_dir.yml","_type":"yaml","_source":"content","_file":"2.api/_dir.yml","_extension":"yml"},{"_path":"/api/utils","_dir":"api","_draft":false,"_partial":false,"_locale":"","_empty":false,"title":"Utils","description":"Discover all available utils.","body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"utils"},"children":[{"type":"text","value":"Utils"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Discover all available utils."}]},{"type":"element","tag":"h2","props":{"id":"definemongoosemodel"},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"defineMongooseModel"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This function creates a new Mongoose model with schema. Example usage:"}]},{"type":"element","tag":"code-group","props":{},"children":[{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"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","filename":"named parameters","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineMongooseModel"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"({\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" name: "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'User'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" schema: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":4},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" email: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":5},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" type: "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'string'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":6},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" required: "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":7},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" unique: "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":8},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" },\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":9},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" },\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":10},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" options: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":11},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" \n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":12},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" },\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":13},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"hooks"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"schema"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":") {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":14},"children":[{"type":"element","tag":"span","props":{},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":15},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" },\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":16},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"})"}]}]}]}]}]},{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"import { defineMongooseModel } from '#nuxt/mongoose'\n\nexport const User = defineMongooseModel('User', {\n email: {\n type: 'string',\n required: true,\n unique: true,\n },\n}, {\n \n}, (schema) => {\n\n})\n","filename":"positional parameters","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" { defineMongooseModel } "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'#nuxt/mongoose'\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineMongooseModel"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'User'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":", {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":4},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" email: {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":5},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" type: "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'string'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":6},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" required: "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":7},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" unique: "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":",\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":8},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" },\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":9},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"}, {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":10},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" \n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":11},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"}, ("}]},{"type":"element","tag":"span","props":{"class":"ct-443230"},"children":[{"type":"text","value":"schema"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"=>"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" {\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":12},"children":[{"type":"element","tag":"span","props":{},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":13},"children":[{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"})"}]}]}]}]}]}]},{"type":"element","tag":"table","props":{},"children":[{"type":"element","tag":"thead","props":{},"children":[{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Key"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Type"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Require"}]}]},{"type":"element","tag":"th","props":{"align":null},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Description"}]}]}]}]},{"type":"element","tag":"tbody","props":{},"children":[{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"name"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Name of Model"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"schema"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"a","props":{"href":"https://mongoosejs.com/docs/schematypes.html","rel":["nofollow"]},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"SchemaDefinition"}]}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"true"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Schema Definition of Model"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"options"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"a","props":{"href":"https://mongoosejs.com/docs/guide.html#options","rel":["nofollow"]},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"SchemaOptions"}]}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"false"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Schema Options for Model"}]}]},{"type":"element","tag":"tr","props":{},"children":[{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"hooks"}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"element","tag":"a","props":{"href":"https://mongoosejs.com/docs/middleware.html","rel":["nofollow"]},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"(schema: Schema<T>) => void"}]}]}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"false"}]},{"type":"element","tag":"td","props":{"align":null},"children":[{"type":"text","value":"Schema Hooks Function to customize Model"}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"definemongooseconnection"},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"defineMongooseConnection"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This function creates a new Mongoose connection."}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"text","value":" 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 "},{"type":"element","tag":"a","props":{"href":"https://github.com/arashsheyda/nuxt-mongoose/blob/main/src/runtime/server/plugins/mongoose.db.ts","rel":["nofollow"]},"children":[{"type":"text","value":"here"}]},{"type":"text","value":"."}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Example usage:"}]},{"type":"element","tag":"code","props":{"className":["language-ts"],"code":"import { defineMongooseConnection } from '#nuxt/mongoose'\n\nexport const connection = defineMongooseConnection('mongodb://127.0.0.1/nuxt-mongoose')\n","language":"ts","meta":""},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line","line":1},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" { defineMongooseConnection } "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'#nuxt/mongoose'\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":2},"children":[{"type":"element","tag":"span","props":{},"children":[{"type":"text","value":"\n"}]}]},{"type":"element","tag":"span","props":{"class":"line","line":3},"children":[{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-998471"},"children":[{"type":"text","value":"connection"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-942366"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-923966"},"children":[{"type":"text","value":"defineMongooseConnection"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"class":"ct-667011"},"children":[{"type":"text","value":"'mongodb://127.0.0.1/nuxt-mongoose'"}]},{"type":"element","tag":"span","props":{"class":"ct-935781"},"children":[{"type":"text","value":")"}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".dark .ct-942366{color:#FF7B72;}\n.ct-942366{color:#CF222E;}\n.dark .ct-935781{color:#C9D1D9;}\n.ct-935781{color:#24292F;}\n.dark .ct-998471{color:#79C0FF;}\n.ct-998471{color:#0550AE;}\n.dark .ct-923966{color:#D2A8FF;}\n.ct-923966{color:#8250DF;}\n.dark .ct-667011{color:#A5D6FF;}\n.ct-667011{color:#0A3069;}\n.dark .ct-443230{color:#FFA657;}\n.ct-443230{color:#953800;}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"definemongoosemodel","depth":2,"text":"defineMongooseModel"},{"id":"definemongooseconnection","depth":2,"text":"defineMongooseConnection"}]}},"_type":"markdown","_id":"content:2.api:1.utils.md","_source":"content","_file":"2.api/1.utils.md","_extension":"md"},{"_path":"/api/devtools","_dir":"api","_draft":false,"_partial":false,"_locale":"","_empty":false,"title":"Devtools (beta)","description":"nuxt-mongoose comes with a Nuxt Devtools module that allows you to manage your collections and generate api-endpoints & schemas...","body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"devtools-beta"},"children":[{"type":"text","value":"Devtools (beta)"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt-mongoose"}]},{"type":"text","value":" comes with a "},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxt/devtools","rel":["nofollow"]},"children":[{"type":"text","value":"Nuxt Devtools"}]},{"type":"text","value":" module that allows you to manage your collections and generate api-endpoints & schemas..."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Here is a demo video:"}]},{"type":"element","tag":"video-player","props":{"src":"https://www.youtube.com/watch?v=hK0npSfr_Vs"},"children":[]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:2.api:2.devtools.md","_source":"content","_file":"2.api/2.devtools.md","_extension":"md"}],"navigation":[{"title":"Getting Started","_path":"/getting-started","children":[{"title":"Setup","_path":"/getting-started/setup"},{"title":"Configuration","_path":"/getting-started/configuration"}],"icon":"tabler:brand-mongodb","redirect":"/getting-started/setup"},{"title":"API","_path":"/api","children":[{"title":"Utils","_path":"/api/utils"},{"title":"Devtools (beta)","_path":"/api/devtools"}],"icon":"tabler:book"}]}