fix: add useMongoose composable
This commit is contained in:
11
README.md
11
README.md
@ -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
|
## License
|
||||||
|
|
||||||
[MIT License](./LICENSE)
|
[MIT License](./LICENSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user