Nuxt 3 module for MongoDB with Mongoose. Version 1.1.2 provides seamless integration of Mongoose ODM into Nuxt 3 applications, with auto-import of models from a specified directory, support for multiple connections, and custom model definitions. Released with regular updates, it simplifies database setup for Nuxt 3 projects compared to manual Mongoose configuration. Key differentiators include no-code module auto-imports, schema generation from model files, and built-in Nuxt DevTools support.
npm install nuxt-mongooseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure nuxt-mongoose, define a model, and use it in a Nuxt API endpoint.
Add options: { collection: 'your_collection_name' } when defining the model.Use import syntax instead of require().
Ensure URI is provided in .env or nuxt.config.ts.
Ensure your Nuxt project uses ESM (Nuxt 3 default). Use import syntax correctly.
Set NUXT_MONGOOSE_URI in .env file at project root.
Run `npx nuxi@latest module add nuxt-mongoose` and add 'nuxt-mongoose' to modules array.