New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loopback-extra-filters

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-extra-filters

Provides extra filters for loopback queries

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

loopback-extra-filters

This package is designed to provide filter alternatives under the loopback query data.

The extra filters do not change queries generated by loopback-datasource-juggler, but are applied to the resulting object.

Install

// server/boot/extra-filters.js
'use strict';

const Boot = require('loopback-extra-filters/lib/boot');

module.exports = function(server) {
  Boot.apply(server);
};

Filters

  • has - Check if you have the property.
  • notHas - Check if you do not have the property.
  • isEmpty -Check if array property is empty
  • isNotEmpty - Check if array property is not empty.

Examples

  • Filter:
// Product has category (Ex.: relation belongsTo)
{
  "include": {
    "relation": "category",
  },
  "isHas": "category" //or ["category", ...]
}

// Product has no category (Ex.: relation belongsTo)
{
  "include": {
    "relation": "category",
  },
  "isHas": "category" //or ["category", ...]
}

// Product without items (Ex.: relation hasMany)
{
  "include": {
    "relation": "items",
  },
  "isEmpty": "items" //or ["items", ...]
}

// Product with items (Ex.: relation hasMany)
{
  "include": {
    "relation": "items",
  },
  "isNotEmpty": "items" //or ["items", ...]
}

Keywords

FAQs

Package last updated on 28 Aug 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