# mongoose-bucket

> Pagination on write

Latest version **1.0.0** (published 2017-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongoose-bucket
pnpm add mongoose-bucket
yarn add mongoose-bucket
bun add mongoose-bucket
```

## 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.0 |
| Published | 2017-05-16 |
| First published | 2017-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jaymc |
| Keywords | mongoose, plugin, bucket, pagination, pagination on write |

## Links

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

## 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
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-05-16

## README

# mongoose-bucket
<p align="center">
	<img height="200" width="200" src="https://raw.githubusercontent.com/JayMc/mongoose-bucket/master/logo.png">
</p>

## Basic usage (setup)
```javascript
MySchema = mongoose.Schema({
	parent_id: String,
});

MySchema.plugin(bucket, /* options */);
```

## options
```javascript
const options = {
	limit: 100, // number of items per bucket
	arrayName: 'bucket', // name of the array containing the subdocs
}
```

## Basic usage (save to next bucket)
Callback
```javascript
MySchema.bucketInsert(parent_id, newComment, function (err, parentDoc) {

})
```

Promise
```javascript
MySchema.bucketInsert(parent_id, newComment)
	.then(parentDoc => {

	})
	.catch(error => {

	})
```

## get (dev) going
* nvm use
* npm i
* ??
* npm run test

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