# mongoose-plugin-cursor-pagination

> add getPage method to models

Latest version **1.1.0** (published 2019-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongoose-plugin-cursor-pagination
pnpm add mongoose-plugin-cursor-pagination
yarn add mongoose-plugin-cursor-pagination
bun add mongoose-plugin-cursor-pagination
```

## 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.1.0 |
| Published | 2019-09-18 |
| First published | 2019-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rafael Santos |
| Maintainers | rnsantos |
| Keywords | mongoose, cursor, pagination, plugin |

## Links

- npm: https://www.npmjs.com/package/mongoose-plugin-cursor-pagination
- Repository: https://github.com/rafaelnsantos/mongoose-plugin-cursor-pagination
- Homepage: https://github.com/rafaelnsantos/mongoose-plugin-cursor-pagination#readme
- Issues: https://github.com/rafaelnsantos/mongoose-plugin-cursor-pagination/issues
- npm.io page: https://npm.io/package/mongoose-plugin-cursor-pagination

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^3.3.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

- 1.1.0 (latest) — 2019-09-18
- 1.0.1 — 2019-08-27
- 1.0.0 — 2019-08-25

## README

# mongoose-plugin-dataloader

Adds `getPage` to models.

Works together with mongoose-plugin-datalodear

## Getting Started

> npm install mongoose-plugin-pagination

```js
const { Schema, model } = require('mongoose')
const paginationPlugin = require('mongoose-plugin-pagination')

const schema = {
  username: {
    type: String,
    required: true,
    unique: true
  }
}

const userSchema = new Schema(schema)

userSchema.plugin(paginationPlugin, 20) // default page size

module.exports = model('User', userSchema)
```

```js
const User = require('./user-model');
// optional
let page = {
  size: 5, // ommit for default
  cursor: '5d58b82db5e527505ed65e26,' // or empty for 1st page
}
// optional
let params = {
  username: new Regex('as', 'i')
}
User.getPage(page, params)
```

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