Socket
Socket
Sign inDemoInstall

loopback-default-filter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-default-filter

Loopback 3 default where mixin


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Loopback Default Filter

This loopback middleware replaces the default GET / endpoint with something that is a little more search friendly.

Useage

Install

npm i loopback-default-filter --save

Integrate with Loopback

Include the mixin in your model-config.json file

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

Then add the mix in to your model.json file

"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

"mixins": {
  "DefaultFilter": {
    "where": {
      "field": 10,
    },
    "offset": 100,
    "limit": 20,
  }
},

Keywords

FAQs

Package last updated on 29 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc