# fastify-mongoose-connection

> this package add a db property in fastify object a fastify decorator workks.

Latest version **1.0.1** (published 2020-05-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install fastify-mongoose-connection
pnpm add fastify-mongoose-connection
yarn add fastify-mongoose-connection
bun add fastify-mongoose-connection
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-05-04 |
| First published | 2020-05-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 58.3 KB |
| Known vulnerabilities | 0 (+11 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | sonsor |

## Links

- npm: https://www.npmjs.com/package/fastify-mongoose-connection
- Repository: https://github.com/sonsor/fastify-mongoose
- Homepage: https://github.com/sonsor/fastify-mongoose#readme
- Issues: https://githun.com/sonsor/fastify-mongoose/issues
- npm.io page: https://npm.io/package/fastify-mongoose-connection

## Dependencies (3)

- [fastify](https://npm.io/package/fastify.md) ^2.11.0
- [mongoose](https://npm.io/package/mongoose.md) ^5.7.12
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^1.6.0

## Recent versions

- 1.0.1 (latest) — 2020-05-04

## README

# Fastify Mongoose Connection
this package add a db property in fastify object a fastify decorator workks.

### How to install
```bash
npm i fastify-mongoose-connection
```

### How to access connection
```javascript
const fastify = require('fastify')
 
fastify.register(require('fastify-mongoose-connection'), config)
```
this will add a db property to fastify
```javascript
fastify.db.users.find({});
```

### Configuration properties
```javascript
{
    user: 'root', //database user
    password: 'example', // database password
    name: 'test', //database name
    hosts: [{
        host: 'localhost', // host for a database server
        port: 27017, // port of databaser server
    }],
    options: {} // same as mentioned in mongoose documentation
}
```

## License
MIT

---
_Source: https://npm.io/package/fastify-mongoose-connection · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
