# loopback-default-filter

> Loopback 3 default where mixin

Latest version **1.0.1** (published 2019-05-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install loopback-default-filter
pnpm add loopback-default-filter
yarn add loopback-default-filter
bun add loopback-default-filter
```

## 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-05-29 |
| First published | 2019-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Danwakeem |
| Maintainers | danwakeem |
| Keywords | loopback, mixin, defaults |

## Links

- npm: https://www.npmjs.com/package/loopback-default-filter
- Repository: https://github.com/Danwakeem/loopback-default-filter
- Homepage: https://github.com/Danwakeem/loopback-default-filter#readme
- Issues: https://github.com/Danwakeem/loopback-default-filter/issues
- npm.io page: https://npm.io/package/loopback-default-filter

## Recent versions

- 1.0.1 (latest) — 2019-05-29
- 1.0.0 — 2019-05-29

## README

# Loopback Default Filter
This loopback middleware adds a default filter to requests that accept a query

## Useage

## Install
`npm i loopback-default-filter --save`

## Integrate with Loopback
Include the mixin in your `model-config.json` file

```json
{
  "mixins": [
    "../node_modules/loopback-default-filter"
  ]
}
```

Then add the mix in to your `model.json` file
```json
"mixins": {
  "DefaultFilter": {
    "limit": 10,
    "offset": 0
  }
},
```

## Options
> I know there is supposed to be a way to do this through the loopback scope but it had some strange behavior so I just made a mixin to fix this

You can put whatever where filter you want in the mixin opitons
```json
"mixins": {
  "DefaultFilter": {
    "where": {
      "field": 10,
    },
    "offset": 100,
    "limit": 20,
  }
},
```

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