# commando-provider-mongo

> A MongoDB provider for Commando

Latest version **2.1.0** (published 2021-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install commando-provider-mongo
pnpm add commando-provider-mongo
yarn add commando-provider-mongo
bun add commando-provider-mongo
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2021-02-16 |
| First published | 2017-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Paul Hobbel |
| Maintainers | paulhobbel |
| Keywords | discord.js, commando, discord.js-commando, provider, mongodb, settings |

## Links

- npm: https://www.npmjs.com/package/commando-provider-mongo
- Repository: https://github.com/paulhobbel/commando-provider-mongo
- Homepage: https://github.com/paulhobbel/commando-provider-mongo#readme
- Issues: https://github.com/paulhobbel/commando-provider-mongo/issues
- npm.io page: https://npm.io/package/commando-provider-mongo

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2021-02-16
- 1.2.1 (dev) — 2018-03-12
- 2.0.2 — 2020-12-26
- 2.0.1 — 2020-12-26
- 2.0.0 — 2020-12-26
- 1.3.0 — 2020-11-09
- 1.2.0 — 2018-01-12
- 1.1.1 — 2018-01-12
- 1.1.0 — 2017-12-27
- 1.0.0 — 2017-09-17

## README

# Commando MongoDBProvider
[![Downloads](https://img.shields.io/npm/dt/commando-provider-mongo.svg)](https://www.npmjs.com/package/commando-provider-mongo)
[![Version](https://img.shields.io/npm/v/commando-provider-mongo.svg)](https://www.npmjs.com/package/commando-provider-mongo)
[![Dependency status](https://david-dm.org/ItsDizzy/commando-provider-mongo.svg)](https://david-dm.org/ItsDizzy/commando-provider-mongo)

 MongoDB provider for Commando

## About
[Commando](https://github.com/Gawdl3y/discord.js-commando) is the official framework for [discord.js](https://github.com/hydrabolt/discord.js), I like how easy it is to get started with it and add own commands, types, etc. Recently I started working on a bot that required to be connected to MongoDB. I converted the default SQLLiteProvider into a provider that could use MongoDB as storage.

## Installation
>If you want to use Discord.js v11, use commando-provider-mongo@1.3.0!
```bash
# With Yarn (recommended)
yarn add mongodb commando-provider-mongo

# With NPM
npm install --save mongodb commando-provider-mongo
```

## Usage
Below is an example on how to use it with [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) (recommended). There are probably other mongodb clients whose are able to return a Db instance of MongoClient and you are free to use them. However I will not deliver any support if you use another client.

```js
const MongoClient = require('mongodb').MongoClient;
const MongoDBProvider = require('commando-provider-mongo').MongoDBProvider;

...

client.setProvider(
	MongoClient.connect('mongodb://localhost:27017').then(client => new MongoDBProvider(client, 'abot'))
).catch(console.error);

...
```

## License
MIT © [Paul Hobbel](https://github.com/paulhobbel)

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