UNPKG

ink-docstrap

Version:

[![NPM](https://nodei.co/npm/ink-docstrap.png?downloads=true)](https://nodei.co/npm/ink-docstrap/)

2,200 lines (893 loc) 30.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DocStrap Class: OCollector</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">DocStrap</a> <ul class="nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="module-base.html">base</a> </li> <li> <a href="chains_.html">base/chains</a> </li> <li> <a href="binder.html">documents/binder</a> </li> <li> <a href="model_.html">documents/model</a> </li> <li> <a href="probe.html">documents/probe</a> </li> <li> <a href="schema_.html">documents/schema</a> </li> <li> <a href="collector.html">ink/collector</a> </li> <li> <a href="bussable_.html">mixins/bussable</a> </li> <li> <a href="signalable_.html">mixins/signalable</a> </li> <li> <a href="format.html">strings/format</a> </li> <li> <a href="logger.html">utils/logger</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="base.html">base</a> </li> <li> <a href="chains.html">base/chains</a> </li> <li> <a href="model.html">documents/model</a> </li> <li> <a href="probe.queryOperators.html">queryOperators</a> </li> <li> <a href="probe.updateOperators.html">updateOperators</a> </li> <li> <a href="collector-ACollector.html">ACollector</a> </li> <li> <a href="collector-CollectorBase_.html">CollectorBase</a> </li> <li> <a href="collector-OCollector.html">OCollector</a> </li> <li> <a href="signalable-Signal.html">Signal</a> </li> <li> <a href="logger.Logger.html">Logger</a> </li> </ul> </li> <li class="dropdown"> <a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="schema.html">documents/schema</a> </li> <li> <a href="bussable.html">mixins/bussable</a> </li> <li> <a href="signalable.html">mixins/signalable</a> </li> </ul> </li> <li class="dropdown"> <a href="tutorials.list.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="tutorial-Teeth.html">Brush Teeth</a> </li> <li> <a href="tutorial-Car.html">Drive Car</a> </li> <li> <a href="tutorial-Test.html">Fence Test</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="global.html#utils/logger">utils/logger</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Class: OCollector</h1> <section> <header> <h2> <span class="ancestors"><a href="collector.html">ink/collector</a>~</span> OCollector </h2> </header> <article> <div class="container-overview"> <dt> <h4 class="name" id="OCollector"><span class="type-signature"></span>new OCollector<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>An object based collector</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-251">line 251</a> </li> </ul> </dd> </dl> </dd> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="collector-CollectorBase.html">module:documents/collector~CollectorBase</a></li> </ul> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="length"><span class="type-signature"></span>length<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>Get the size of the collection</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#length">module:documents/collector~CollectorBase#length</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-29">line 29</a> </li> </ul> </dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="all"><span class="type-signature"></span>all<span class="signature">(qu)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Returns true if all items match the query. Aliases as <code>every</code></p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#all">module:documents/collector~CollectorBase#all</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-411">line 411</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <dt> <h4 class="name" id="any"><span class="type-signature"></span>any<span class="signature">(qu)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Returns true if any of the items match the query. Aliases as <code>all</code></p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#any">module:documents/collector~CollectorBase#any</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-422">line 422</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <dt> <h4 class="name" id="every"><span class="type-signature"></span>every<span class="signature">(qu)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Returns true if all items match the query. Aliases as <code>all</code></p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#every">module:documents/collector~CollectorBase#every</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-379">line 379</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <dt> <h4 class="name" id="find"><span class="type-signature"></span>find<span class="signature">(qu)</span><span class="type-signature"> &rarr; {array}</span></h4> </dt> <dd> <div class="description"> <p>Find all records that match a query</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#find">module:documents/collector~CollectorBase#find</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-478">line 478</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The results</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">array</span> </dd> </dl> </dd> <dt> <h4 class="name" id="findKeys"><span class="type-signature"></span>findKeys<span class="signature">(qu)</span><span class="type-signature"> &rarr; {array}</span></h4> </dt> <dd> <div class="description"> <p>Find all records that match a query and returns the keys for those items. This is similar to module:ink/probe.find but instead of returning records, returns the keys. If <code>obj</code> is an object it will return the hash key. If 'obj' is an array, it will return the index</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#findKeys">module:documents/collector~CollectorBase#findKeys</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-466">line 466</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">array</span> </dd> </dl> </dd> <dt> <h4 class="name" id="findOne"><span class="type-signature"></span>findOne<span class="signature">(qu)</span><span class="type-signature"> &rarr; {object}</span></h4> </dt> <dd> <div class="description"> <p>Returns the first record that matches the query. Aliased as <code>seek</code>.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#findOne">module:documents/collector~CollectorBase#findOne</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-455">line 455</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </dd> <dt> <h4 class="name" id="findOneKey"><span class="type-signature"></span>findOneKey<span class="signature">(qu)</span><span class="type-signature"> &rarr; {object}</span></h4> </dt> <dd> <div class="description"> <p>Returns the first record that matches the query and returns its key or index depending on whether <code>obj</code> is an object or array respectively. Aliased as <code>seekKey</code>.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#findOneKey">module:documents/collector~CollectorBase#findOneKey</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-443">line 443</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </dd> <dt> <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(qu)</span><span class="type-signature"> &rarr; {object|array}</span></h4> </dt> <dd> <div class="description"> <p>Remove all items in the object/array that match the query</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute. See module:ink/probe.queryOperators for the operators you can use.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#remove">module:documents/collector~CollectorBase#remove</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-433">line 433</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The array or object as appropriate without the records.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> | <span class="param-type">array</span> </dd> </dl> </dd> <dt> <h4 class="name" id="some"><span class="type-signature"></span>some<span class="signature">(qu)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Returns true if any of the items match the query. Aliases as <code>any</code></p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#some">module:documents/collector~CollectorBase#some</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-390">line 390</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> </dd> <dt> <h4 class="name" id="unique"><span class="type-signature"></span>unique<span class="signature">(qu)</span><span class="type-signature"> &rarr; {array}</span></h4> </dt> <dd> <div class="description"> <p>Returns the set of unique records that match a query</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query to execute.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#unique">module:documents/collector~CollectorBase#unique</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-401">line 401</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">array</span> </dd> </dl> </dd> <dt> <h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">(qu, setDocument)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Updates all records in obj that match the query. See module:ink/probe.updateOperators for the operators that are supported.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>qu</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The query which will be used to identify the records to updated</p></td> </tr> <tr> <td class="name"><code>setDocument</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The update operator. See module:ink/probe.updateOperators</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"> <ul class="dummy"> <li> <a href="collector-CollectorBase.html#update">module:documents/collector~CollectorBase#update</a> </li> </ul> </dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="collector.js.html">documents/collector.js</a>, <a href="collector.js.html#sunlight-1-line-488">line 488</a> </li> </ul> </dd> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> DocStrap Copyright © 2012-2014 The contributors to the JSDoc3 and DocStrap projects. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Mon Jun 2nd 2014 using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <div class="span3"> <div id="toc"></div> </div> <br clear="both"> </div> </div> <!--<script src="scripts/sunlight.js"></script>--> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> $( function () { $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $('.dropdown-toggle').dropdown(); // $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find("code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html(exampleText); lang = lang[1]; } else { lang = "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : true, showMenu:true, enableDoclinks:true } ); } ); </script> <!--Google Analytics--> <!--Navigation and Symbol Display--> </body> </html>