waterline-criteria
Utility library for working with Waterline criterias. Especially useful when building Sails adapters for key/value databases.
Last updated 10 years ago by mikermcneil .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install waterline-criteria 
SYNC missed versions from official npm registry.

waterline-criteria

Utilities for working with Waterline criterias, especially for applying them to in-memory datasets.

This module was 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).

Installation

$ npm install waterline-criteria --save

Usage

var wlFilter = require('waterline-criteria');

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

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

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

Bugs   NPM version

To report a bug, click here.

This is a built-in module in the Sails framework and the sails-disk adapter. It is installed automatically when you run npm install sails.

Version notes

The master branch of this repository holds waterline-criteria used in 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.

Contributing   Build Status

Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.

NPM package info

License

The Sails framework is free and open-source under the MIT License.

Current Tags

  • 2.0.0                                ...           latest (10 years ago)

22 Versions

  • 2.0.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           11 years ago
  • 0.11.2                                ...           11 years ago
  • 0.11.1                                ...           12 years ago
  • 0.11.0                                ...           12 years ago
  • 0.10.7                                ...           13 years ago
  • 0.10.6                                ...           13 years ago
  • 0.10.5                                ...           13 years ago
  • 0.10.4                                ...           13 years ago
  • 0.10.3                                ...           13 years ago
  • 0.10.2                                ...           13 years ago
  • 0.10.1                                ...           13 years ago
  • 0.10.0                                ...           13 years ago
  • 0.9.7                                ...           13 years ago
  • 0.9.6                                ...           13 years ago
  • 0.9.4                                ...           13 years ago
  • 0.9.3                                ...           13 years ago
  • 0.9.2                                ...           13 years ago
  • 0.9.1                                ...           13 years ago
  • 0.9.0                                ...           13 years ago
  • 0.0.0                                ...           13 years ago
Downloads
Total 82
Today 0
This Week 0
This Month 39
Last Day 0
Last Week 1
Last Month 23
Dependencies (2)
Dev Dependencies (1)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE