# mongo-increment

> Increment util for mongoose.

Latest version **1.0.1** (published 2019-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongo-increment
pnpm add mongo-increment
yarn add mongo-increment
bun add mongo-increment
```

## 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 | 2019-11-21 |
| First published | 2019-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Mikhail Semin |
| Maintainers | bifot |

## Links

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

## Dependencies (1)

- [mongoose](https://npm.io/package/mongoose.md) ^5.7.11

## Recent versions

- 1.0.1 (latest) — 2019-11-21
- 1.0.0 — 2019-11-21

## README

# mongo-increment

Increment util for mongoose.

## Install

```sh
$ npm i mongo-increment -S
```

## Usage

```js
const mongoose = require('mongoose');
const mongoIncrement = require('mongo-increment')(mongoose);

mongoose.connect(process.env.MONGODB_URL, {
  useUnifiedTopology: true,
  useNewUrlParser: true,
  useCreateIndex: true,
  useFindAndModify: false,
});

const Users = mongoose.model('users', new mongoose.Schema({
  _id: Number,
  firstName: String,
  lastName: String,
}, { _id: false }));

const Reviews = mongoose.model('reviews', new mongoose.Schema({
  _id: Number,
  text: String,
  starts: Number,
}, { _id: false }));

mongoIncrement(Users, Reviews, ...); // => Promise

module.exports = {
  Users,
  Reviews,
};
```

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