localCollection
A Sift.JS wrapper that adds array modification and MongoDB collection-like instantiation for easy access to collections.
MongoDB inspired array filtering
For extended documentation, checkout MongoDB's Docs and Sift.JS
Installation
npm install localcollection --save var localCollection = ; var Collection = YOUR_ARRAY/OBJECT ;
Node.js Examples
var localCollection = ; var someArray = id: 1 id:2 id:3; var SomeArray = someArray; // FindSomeArray;// [ {id:2} ] // FindOneSomeArray;// {id:2} // RemoveSomeArray;// [ {id:1}, {id:3} ] // CountSomeArray// 1 // UpdateSomeArray;// [ {id:1}, {id:3, magic:true} ] // InsertSomeArray;// [ {id:1}, {id:3, magic:true}, {yoman: 'guild'} ] // FindAndModifySomeArray;// [ {yoman:'guild', happiness:true} ]
Sift Dependency
This package is a simple wrapper on Sift.js. For more information on functionality and features, see Sift.js