forerunnerdb
Version:
A NoSQL document store database for browsers and Node.js.
1,028 lines (266 loc) • 12.6 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: CollectionGroup</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: CollectionGroup</h1>
<section>
<header>
<h2>
CollectionGroup
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="CollectionGroup"><span class="type-signature"></span>new CollectionGroup<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Creates a new collection group. Collection groups allow single operations to be
propagated to multiple collections at once. CRUD operations against a collection
group are in fed to the group's collections. Useful when separating out slightly
different data into multiple collections but querying as one collection.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CollectionGroup.js.html">CollectionGroup.js</a>, <a href="CollectionGroup.js.html#line18">line 18</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="_addOldView"><span class="type-signature">(private) </span>_addOldView<span class="signature">(view)</span><span class="type-signature"> → {<a href="Collection.html">Collection</a>}</span></h4>
<div class="description">
Adds a view to the internal view lookup.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>view</code></td>
<td class="type">
<span class="param-type"><a href="View.html">View</a></span>
</td>
<td class="description last">The view to add.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="OldView.js.html">OldView.js</a>, <a href="OldView.js.html#line627">line 627</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Collection.html">Collection</a></span>
</dd>
</dl>
<h4 class="name" id="_removeOldView"><span class="type-signature">(private) </span>_removeOldView<span class="signature">(view)</span><span class="type-signature"> → {<a href="Collection.html">Collection</a>}</span></h4>
<div class="description">
Removes a view from the internal view lookup.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>view</code></td>
<td class="type">
<span class="param-type"><a href="View.html">View</a></span>
</td>
<td class="description last">The view to remove.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="OldView.js.html">OldView.js</a>, <a href="OldView.js.html#line641">line 641</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Collection.html">Collection</a></span>
</dd>
</dl>
<h4 class="name" id="drop"><span class="type-signature"></span>drop<span class="signature">()</span><span class="type-signature"> → {<a href="global.html#boolean">boolean</a>}</span></h4>
<div class="description">
Drops a collection group from the database.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CollectionGroup.js.html">CollectionGroup.js</a>, <a href="CollectionGroup.js.html#line261">line 261</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True on success, false on failure.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#boolean">boolean</a></span>
</dd>
</dl>
<h4 class="name" id="primaryKey"><span class="type-signature"></span>primaryKey<span class="signature">(keyName<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
Gets / sets the primary key for this collection group.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>keyName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The name of the primary key.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CollectionGroup.js.html">CollectionGroup.js</a>, <a href="CollectionGroup.js.html#line58">line 58</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id="removeById"><span class="type-signature"></span>removeById<span class="signature">(id)</span><span class="type-signature"></span></h4>
<div class="description">
Helper method that removes a document that matches the given id.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the document to remove.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CollectionGroup.js.html">CollectionGroup.js</a>, <a href="CollectionGroup.js.html#line233">line 233</a>
</li></ul></dd>
</dl>
<h4 class="name" id="subset"><span class="type-signature"></span>subset<span class="signature">(query, options)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
Uses the passed query to generate a new collection with results
matching the query parameters.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>query</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="CollectionGroup.js.html">CollectionGroup.js</a>, <a href="CollectionGroup.js.html#line248">line 248</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ActiveBucket.html">ActiveBucket</a></li><li><a href="Angular.html">Angular</a></li><li><a href="AutoBind.html">AutoBind</a></li><li><a href="BinaryTree.html">BinaryTree</a></li><li><a href="Collection.html">Collection</a></li><li><a href="CollectionGroup.html">CollectionGroup</a></li><li><a href="Core.html">Core</a></li><li><a href="Db.html">Db</a></li><li><a href="Document.html">Document</a></li><li><a href="Grid.html">Grid</a></li><li><a href="Highchart.html">Highchart</a></li><li><a href="IndexBinaryTree.html">IndexBinaryTree</a></li><li><a href="IndexHashMap.html">IndexHashMap</a></li><li><a href="Infinilist.html">Infinilist</a></li><li><a href="KeyValueStore.html">KeyValueStore</a></li><li><a href="Metrics.html">Metrics</a></li><li><a href="OldView.html">OldView</a></li><li><a href="Operation.html">Operation</a></li><li><a href="Overload.html">Overload</a></li><li><a href="Path.html">Path</a></li><li><a href="Persist.html">Persist</a></li><li><a href="ReactorIO.html">ReactorIO</a></li><li><a href="Serialiser.html">Serialiser</a></li><li><a href="Shared.overload.html">overload</a></li><li><a href="View.html">View</a></li></ul><h3>Mixins</h3><ul><li><a href="ChainReactor.html">ChainReactor</a></li><li><a href="crcTable.html">crcTable</a></li><li><a href="Shared.html">Shared</a></li></ul><h3>Global</h3><ul><li><a href="global.html#%2522boolean,function%2522">"boolean, function"</a></li><li><a href="global.html#%2522string,*,function%2522">"string, *, function"</a></li><li><a href="global.html#%2522string,function%2522">"string, function"</a></li><li><a href="global.html#boolean">boolean</a></li><li><a href="global.html#function">function</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Thu Nov 19 2015 13:31:32 GMT+0000 (GMT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>