1.0.13 • Published 9 months ago

nuxt-mongodb v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Nuxt MongoDB

A simple way to use mongoDB in your Nuxt 3 project.

Usage

Install the module:

npm i -D nuxt-mongodb

Add nuxt-mongodb in the modules array in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['nuxt-mongodb'],
})

Add your mongo connection string and main database name in your .env file:

MONGO_CONNECTION_STRING={{your_mongo_connection_string}}
MONGO_DB={{your_mongo_db_name}}

When you start your project, mongo will connect and you can use it like this:

import { mongo } from '#nuxt-mongodb'

const db = mongo.db()
const response = await db.collection('YOUR_COLLECTION').find()
1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.6

9 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago