2 Commits

Author SHA1 Message Date
ac24680bd4 chore(release): v0.0.6 2023-05-16 13:46:26 +03:00
d381058591 fix: remove useMongoose composable 2023-05-16 13:44:13 +03:00
4 changed files with 14 additions and 20 deletions

View File

@ -1,6 +1,19 @@
# Changelog # Changelog
## v0.0.6
[compare changes](https://github.com/arashsheyda/nuxt-mongoose/compare/v0.0.5...v0.0.6)
### 🩹 Fixes
- Remove useMongoose composable ([d381058](https://github.com/arashsheyda/nuxt-mongoose/commit/d381058))
### ❤️ Contributors
- Arashsheyda <sheidaeearash1999@gmail.com>
## v0.0.5 ## v0.0.5
[compare changes](https://github.com/arashsheyda/nuxt-mongoose/compare/v0.0.4...v0.0.5) [compare changes](https://github.com/arashsheyda/nuxt-mongoose/compare/v0.0.4...v0.0.5)

View File

@ -83,17 +83,6 @@ export const User = defineMongooseModel({
}) })
``` ```
### useMongoose
This composable returns the Mongoose DB instance. Example usage:
```vue
<script lang="ts" setup>
const mongoose = useMongoose()
const user = await mongoose.db.collection('users').findOne()
</script>
```
## License ## License
[MIT License](./LICENSE) [MIT License](./LICENSE)

View File

@ -1,7 +1,7 @@
{ {
"name": "nuxt-mongoose", "name": "nuxt-mongoose",
"type": "module", "type": "module",
"version": "0.0.5", "version": "0.0.6",
"description": "Nuxt 3 module for MongoDB with Mongoose", "description": "Nuxt 3 module for MongoDB with Mongoose",
"license": "MIT", "license": "MIT",
"repository": { "repository": {

View File

@ -1,8 +0,0 @@
import type { mongo } from 'mongoose'
import { connection } from 'mongoose'
export function useMongoose(): { db: mongo.Db } {
return {
db: connection?.db,
}
}