# mongoose-faucet-alter

> An easy way to process large document sets with mongoose.

Latest version **0.1.4** (published 2018-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongoose-faucet-alter
pnpm add mongoose-faucet-alter
yarn add mongoose-faucet-alter
bun add mongoose-faucet-alter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2018-10-23 |
| First published | 2018-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Layne Moseley |
| Maintainers | pagewang |
| Keywords | mongoose |

## Links

- npm: https://www.npmjs.com/package/mongoose-faucet-alter
- Repository: https://github.com/idottv/mongoose-faucet
- Homepage: https://github.com/idottv/mongoose-faucet#readme
- Issues: https://github.com/idottv/mongoose-faucet/issues
- npm.io page: https://npm.io/package/mongoose-faucet-alter

## Dependencies (1)

- [async](https://npm.io/package/async.md) ^2.6.1

## 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.1.4 (latest) — 2018-10-23
- 0.1.3 — 2018-07-20

## README

mongoose-faucet
===============

An easy way to process large document sets with mongoose.

If you have ever tried to run some migration operation on a few million documents, you have probably run into problems with either memory usage or parallelization.

Faucet helps by iterating your mongoose model in a throttled way so all you have to worry about is your single update

# Install
```
npm install mongoose-faucet
```

## API
```
faucet = require "mongoose-faucet"
faucet MongooseModel, query, processingFunction, [options], cb
```
where
- `query` is a json mongo query
- `processingFunction` is a function that takes a document and a callback

`options` is an optional parameter hash that defines a few things, here are the defaults
```
{
  "concurrency" : 100, // Default: 100. The number of concurrent updates that can run
  "snapshot": true, // Default: true. Run a snapshot query, this is often neccesary as iterating over a cursor can present the same document multiple times.
  "lean" : false // Default: false. Lean your mongoose documents
  "batch" : 1000 // If batch is defined, processingFunction will be passed an array of size "batch" instead of a single item
}

```

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