Socket
Socket
Sign inDemoInstall

waterline-criteria

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waterline-criteria

Utility library for use in Sails adapters where you need to filter a list of output using a criteria object


Version published
Weekly downloads
15K
decreased by-14.85%
Maintainers
2
Weekly downloads
 
Created
Source

Waterline-Criteria

Helper module designed for adapters which communicate with key/value stores such as Sails-Disk, Sails-Memory, and sails-redis (i.e. they already implement the semantic interface, but need to implement the queryable interface)

========================================

Contents

Jump to...
IBrowser
IINode.js
IIIVersion Notes
IVLicense

========================================

For the Browser

Installation
$ bower install waterline-criteria
Basic Usage
    <!-- .... -->
  </body>
  <script type="text/javascript" src="./path/to/bower_components/waterline-criteria/index.js"></script>
  <script type="text/javascript">
    var someData = [{
      id: 1,
      name: 'Lyra'
    }, {
      id: 2,
      name 'larry'
    }];
    
    var x = wlFilter(someData, {
      where: {
        name: { contains: 'lyr' }
      }
    }).results;
    
    // x ==> [{name: 'Lyra', id: 1}]
  </script>
</html>

========================================

For Node.js

Installation
$ npm install waterline-criteria
Basic Usage
var wlFilter = require('waterline-criteria');

var someData = [{
  id: 1,
  name: 'Lyra'
}, {
  id: 2,
  name 'larry'
}];

var x = wlFilter(someData, {
  where: {
    name: { contains: 'lyr' }
  }
}).results;

// x ==> [{name: 'Lyra', id: 1}]

========================================

Version Notes

The master branch of this repository holds waterline-criteria for Sails versions 0.10.0 and up. If you're looking for the version for the v0.9.x releases of Sails, the source is located here.

Roadmap
  1. Benchmark
  2. Optimize
  3. There is a possibility that waterline-criteria will eventually become a dependency of Waterline core, since it may make sense to merge the integrator submodule from Waterline core (in-memory populates/joins) into this library.

========================================

License

MIT © 2014 Mike McNeil, Balderdash & contributors

This module is part of the Sails framework, and is free and open-source under the MIT License.

image_squidhome@2x.png

Keywords

FAQs

Package last updated on 16 May 2014

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