fix: add useMongoose composable

This commit is contained in:
arashsheyda
2023-04-25 13:30:31 +03:00
parent d152597155
commit 58ca500acc

View File

@ -83,6 +83,17 @@ 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
[MIT License](./LICENSE)