# gamecollection-mongodb

> MongoDB wrapper to retrieve data from your game collection

Latest version **0.3.0** (published 2018-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamecollection-mongodb
pnpm add gamecollection-mongodb
yarn add gamecollection-mongodb
bun add gamecollection-mongodb
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2018-06-15 |
| First published | 2018-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 96 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Patrick Kraaij |
| Maintainers | patrickkraaij |
| Keywords | games, mongodb |

## Links

- npm: https://www.npmjs.com/package/gamecollection-mongodb
- Repository: https://github.com/patrickkraaij/gamecollection-mongodb
- Homepage: https://github.com/patrickkraaij/gamecollection-mongodb#readme
- Issues: https://github.com/patrickkraaij/gamecollection-mongodb/issues
- npm.io page: https://npm.io/package/gamecollection-mongodb

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^3.0.8

## 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

- 0.3.0 (latest) — 2018-06-15
- 0.2.0 — 2018-06-04
- 0.1.0 — 2018-05-17
- 0.0.1 — 2018-05-16

## README

gamecollection-mongodb
==================

MongoDB wrapper to retrieve data for your game collection

## Table of Contents

1. [Configuration](#configuration)
1. [Require / Import](#require)
2. [Available functions](#functions)

## Configuration
<a name="configuration"></a>
Create a hidden file called `.gamecollection.config.js` in your home directory to make a connection to your MongoDB database.

``` shell
$ touch ~/.gamecollection.config.js
```

``` javascript
module.exports = {
  url: 'mongodb://[username:password@]host1[:port1][/[database][?options]]',
  db: 'nameOfYourDatabase',
  collection: 'games'
};
```

## Require / Import
``` shell
$ yarn add gamecollection-mongodb
```
or
``` shell
$ npm install --save gamecollection-mongodb
```
<a name="configuration"></a>
Require and use it in your application
``` javascript
const gcdb = require('gamecollection-mongodb');
const gamesPerPlatform = await gcdb.getGamesPerPlatform();
```

## Available functions
<a name="functions"></a>

``` javascript
async getGames();
// outputs [{}, {}, ...]
async getGamesPerPlatform();
/* outputs
[
  {
    platform: string,
    games: [{}, {}, ...]
  },
  ...
]
*/
async getGame(mongodbID);
/* outputs
{
  title: string
  platform: array
  releaseDate: string
  overview: string
  ESRB: string
  players: string
  youtube: string
  rating: string
  similar: array
  publisher: string
  developer: string
  genres: array
  images: array
}
*/
async addGame(Object);
async updateGame(mongodbID, field, value);
async deleteGame(mongodbID);
async dropGameCollection();
```

## Contributing
<a name="contributing"></a>
When contributing, please respect the ESLint rules and add unit tests.

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