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)
========================================
Jump to... | |
---|---|
I | Browser |
II | Node.js |
III | Version Notes |
IV | License |
========================================
$ bower install offshore-criteria
<!-- .... -->
</body>
<script type="text/javascript" src="./path/to/bower_components/offshore-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>
========================================
$ npm install offshore-criteria
var wlFilter = require('offshore-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}]
========================================
The master branch of this repository holds offshore-criteria for Offshore versions 0.0.1 and up.
========================================
MIT © 2014 Mike McNeil, Balderdash & contributors © 2015 Atlantis Software
This module is part of the Offshore ORM, and is free and open-source under the MIT License.