forerunnerdb
Version:
A NoSQL document store database for browsers and Node.js.
2,901 lines (718 loc) • 194 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Collection</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: Collection</h1>
<section>
<header>
<h2>Collection</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Collection"><span class="type-signature"></span>new Collection<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Creates a new collection. Collections store multiple documents and
handle CRUD against those documents.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line24">line 24</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<ul><li><a href="#collateAdd"><span class="type-signature">(static) </span>collateAdd<span class="signature">(collection, keyName<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#collateAdd"><span class="type-signature">(static) </span>collateAdd<span class="signature">(collection, process)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent, callback)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(callback)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(callback)</span><span class="type-signature"></span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent, callback)</span><span class="type-signature"></span></a></li><li><a href="#grid"><span class="type-signature">(static) </span>grid<span class="signature">(selector, template, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#isLinked"><span class="type-signature">(static) </span>isLinked<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></a></li><li><a href="#link"><span class="type-signature">(static) </span>link<span class="signature">(outputTargetSelector, templateSelector, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#link"><span class="type-signature">(static) </span>link<span class="signature">(scope, varName, options<span class="signature-attributes">opt</span>, beforeAngularToForerunner<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#link"><span class="type-signature">(static) </span>link<span class="signature">(scope, varName, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, callback)</span><span class="type-signature"></span></a></li><li><a href="#setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(objectType, objectName, query, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(query, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(collectionName, query, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(objectType, objectName, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(query, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(objectType, objectName, query, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(collectionName, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(collectionName, query, options, callback)</span><span class="type-signature"></span></a></li><li><a href="#sync"><span class="type-signature">(static) </span>sync<span class="signature">(callback)</span><span class="type-signature"></span></a></li><li><a href="#unGrid"><span class="type-signature">(static) </span>unGrid<span class="signature">(selector, template, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#unlink"><span class="type-signature">(static) </span>unlink<span class="signature">(outputTargetSelector, templateSelector)</span><span class="type-signature"></span></a></li><li><a href="#_insertHandle"><span class="type-signature"></span>_insertHandle<span class="signature">(data, index<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#count"><span class="type-signature"></span>count<span class="signature">()</span><span class="type-signature"> → {Number}</span></a></li><li><a href="#data"><span class="type-signature"></span>data<span class="signature">()</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#diff"><span class="type-signature"></span>diff<span class="signature">(collection)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#distinct"><span class="type-signature"></span>distinct<span class="signature">(path, query<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#drop"><span class="type-signature"></span>drop<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {boolean}</span></a></li><li><a href="#dropChart"><span class="type-signature"></span>dropChart<span class="signature">(selector)</span><span class="type-signature"></span></a></li><li><a href="#ensureIndex"><span class="type-signature"></span>ensureIndex<span class="signature">(keys, options)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#explain"><span class="type-signature"></span>explain<span class="signature">(query, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#filter"><span class="type-signature"></span>filter<span class="signature">(query<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, func)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#filterUpdate"><span class="type-signature"></span>filterUpdate<span class="signature">(query, func, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#find"><span class="type-signature"></span>find<span class="signature">(query, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#findById"><span class="type-signature"></span>findById<span class="signature">(id, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#findOne"><span class="type-signature"></span>findOne<span class="signature">()</span><span class="type-signature"> → {*}</span></a></li><li><a href="#findSub"><span class="type-signature"></span>findSub<span class="signature">(match, path, subDocQuery<span class="signature-attributes">opt</span>, subDocOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#findSubOne"><span class="type-signature"></span>findSubOne<span class="signature">(match, path, subDocQuery<span class="signature-attributes">opt</span>, subDocOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#group"><span class="type-signature"></span>group<span class="signature">(groupObj, arr)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#index"><span class="type-signature"></span>index<span class="signature">(name)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#indexOf"><span class="type-signature"></span>indexOf<span class="signature">(query, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Number}</span></a></li><li><a href="#indexOfDocById"><span class="type-signature"></span>indexOfDocById<span class="signature">(itemLookup, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Number}</span></a></li><li><a href="#init"><span class="type-signature"></span>init<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#insert"><span class="type-signature"></span>insert<span class="signature">(data, index<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#insertIndexViolation"><span class="type-signature"></span>insertIndexViolation<span class="signature">(doc)</span><span class="type-signature"> → {Boolean}</span></a></li><li><a href="#isProcessingQueue"><span class="type-signature"></span>isProcessingQueue<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></a></li><li><a href="#isSubsetOf"><span class="type-signature"></span>isSubsetOf<span class="signature">(collection)</span><span class="type-signature"> → {Boolean}</span></a></li><li><a href="#lastOp"><span class="type-signature"></span>lastOp<span class="signature">()</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#load"><span class="type-signature"></span>load<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#load"><span class="type-signature"></span>load<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#loadCustom"><span class="type-signature"></span>loadCustom<span class="signature">(myData, callback)</span><span class="type-signature"></span></a></li><li><a href="#odm"><span class="type-signature"></span>odm<span class="signature">()</span><span class="type-signature"> → {<a href="Odm.html">Odm</a>}</span></a></li><li><a href="#options"><span class="type-signature"></span>options<span class="signature">(obj<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#peek"><span class="type-signature"></span>peek<span class="signature">(search, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#persistedSize"><span class="type-signature"></span>persistedSize<span class="signature">(callback)</span><span class="type-signature"></span></a></li><li><a href="#primaryKey"><span class="type-signature"></span>primaryKey<span class="signature">(keyName<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#processQueue"><span class="type-signature"></span>processQueue<span class="signature">(type, callback, resultObj<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#remove"><span class="type-signature"></span>remove<span class="signature">(query<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#removeById"><span class="type-signature"></span>removeById<span class="signature">(id)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#removeByIndex"><span class="type-signature"></span>removeByIndex<span class="signature">(index)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#save"><span class="type-signature"></span>save<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#save"><span class="type-signature"></span>save<span class="signature">(callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></a></li><li><a href="#saveCustom"><span class="type-signature"></span>saveCustom<span class="signature">(callback)</span><span class="type-signature"></span></a></li><li><a href="#sort"><span class="type-signature"></span>sort<span class="signature">(sortObj, arr)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#subset"><span class="type-signature"></span>subset<span class="signature">(query, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#transform"><span class="type-signature"></span>transform<span class="signature">(obj)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#transformIn"><span class="type-signature"></span>transformIn<span class="signature">(data)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#transformOut"><span class="type-signature"></span>transformOut<span class="signature">(data)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#truncate"><span class="type-signature"></span>truncate<span class="signature">()</span><span class="type-signature"> → {<a href="Collection.html">Collection</a>}</span></a></li><li><a href="#unSync"><span class="type-signature"></span>unSync<span class="signature">()</span><span class="type-signature"> → {boolean}</span></a></li><li><a href="#update"><span class="type-signature"></span>update<span class="signature">(query, update, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#updateById"><span class="type-signature"></span>updateById<span class="signature">(id, update, options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Object}</span></a></li><li><a href="#upsert"><span class="type-signature"></span>upsert<span class="signature">(obj, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array}</span></a></li><li><a href="#view"><span class="type-signature"></span>view<span class="signature">(name, query, options)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#when"><span class="type-signature"></span>when<span class="signature">(query)</span><span class="type-signature"> → {<a href="Condition.html">Condition</a>}</span></a></li></ul>
<h4 class="name" id=".collateAdd"><span class="type-signature">(static) </span>collateAdd<span class="signature">(collection, keyName<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a data source to collate data from and specifies the
key name to collate data to.
</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>collection</code></td>
<td class="type">
<span class="param-type"><a href="Collection.html">Collection</a></span>
</td>
<td class="attributes">
</td>
<td class="description last">The collection to collate data from.</td>
</tr>
<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">Optional name of the key to collate data to.
If none is provided the record CRUD is operated on the root collection
data.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line3616">line 3616</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".collateAdd"><span class="type-signature">(static) </span>collateAdd<span class="signature">(collection, process)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a data source to collate data from and specifies a process
method that will handle the collation functionality (for custom
collation).
</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>collection</code></td>
<td class="type">
<span class="param-type"><a href="Collection.html">Collection</a></span>
</td>
<td class="description last">The collection to collate data from.</td>
</tr>
<tr>
<td class="name"><code>process</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The process method.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line3681">line 3681</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and optionally drop persistent storage.
</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>removePersistent</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">True to drop persistent storage, false to keep it.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="NodePersist.js.html">NodePersist.js</a>, <a href="NodePersist.js.html#line498">line 498</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collections and optionally drop persistent storage with callback.
</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>removePersistent</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">True to drop persistent storage, false to keep it.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback method.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Persist.js.html">Persist.js</a>, <a href="Persist.js.html#line669">line 669</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and optionally drop persistent storage.
</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>removePersistent</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">True to drop persistent storage, false to keep it.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Persist.js.html">Persist.js</a>, <a href="Persist.js.html#line643">line 643</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and persistent storage with callback.
</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback method.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Persist.js.html">Persist.js</a>, <a href="Persist.js.html#line631">line 631</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and persistent storage.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Persist.js.html">Persist.js</a>, <a href="Persist.js.html#line620">line 620</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and persistent storage.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="NodePersist.js.html">NodePersist.js</a>, <a href="NodePersist.js.html#line475">line 475</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collection and persistent storage with callback.
</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback method.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="NodePersist.js.html">NodePersist.js</a>, <a href="NodePersist.js.html#line486">line 486</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">(removePersistent, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Drop collections and optionally drop persistent storage with callback.
</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>removePersistent</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">True to drop persistent storage, false to keep it.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Callback method.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="NodePersist.js.html">NodePersist.js</a>, <a href="NodePersist.js.html#line524">line 524</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".grid"><span class="type-signature">(static) </span>grid<span class="signature">(selector, template, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
Creates a grid and assigns the collection as its data source.
</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>selector</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last">jQuery selector of grid output target.</td>
</tr>
<tr>
<td class="name"><code>template</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last">The table template to use when rendering the grid.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The options object to apply to the grid.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line561">line 561</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id=".isLinked"><span class="type-signature">(static) </span>isLinked<span class="signature">()</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Checks if the instance is data-bound to any DOM elements.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="AutoBind.js.html">AutoBind.js</a>, <a href="AutoBind.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if linked, false if not.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".link"><span class="type-signature">(static) </span>link<span class="signature">(outputTargetSelector, templateSelector, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Creates a link to the DOM between the collection data and the elements
in the passed output selector. When new elements are needed or changes
occur the passed templateSelector is used to get the template that is
output to the DOM.
</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>outputTargetSelector</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>templateSelector</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional extra options.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="AutoBind.js.html">AutoBind.js</a>, <a href="AutoBind.js.html#line56">line 56</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>unlink</li>
</ul>
</dd>
</dl>
<h4 class="name" id=".link"><span class="type-signature">(static) </span>link<span class="signature">(scope, varName, options<span class="signature-attributes">opt</span>, beforeAngularToForerunner<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Creates a link to the DOM between the collection data and the elements
in the passed output selector. When new elements are needed or changes
occur the passed templateSelector is used to get the template that is
output to the DOM.
</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>scope</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>varName</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional extra options.</td>
</tr>
<tr>
<td class="name"><code>beforeAngularToForerunner</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Provides an optional function
that allows you to modify data before angularJS updates ForerunnerDB with
data from a view that has changed (like when a user edits a form element
value that has been data-bound via ng-model).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Angular.js.html">Angular.js</a>, <a href="Angular.js.html#line28">line 28</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>unlink</li>
</ul>
</dd>
</dl>
<h4 class="name" id=".link"><span class="type-signature">(static) </span>link<span class="signature">(scope, varName, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Creates a link to the DOM between the collection data and the elements
in the passed output selector. When new elements are needed or changes
occur the passed templateSelector is used to get the template that is
output to the DOM.
</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>scope</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>varName</code></td>
<td class="type">
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">Optional extra options.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Angular.js.html">Angular.js</a>, <a href="Angular.js.html#line146">line 146</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>unlink</li>
</ul>
</dd>
</dl>
<h4 class="name" id=".setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the collection's data to the array / documents passed. If any
data already exists in the collection it will be removed before the
new data is set via the remove() method, and the remove event will
fire as well.
</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>data</code></td>
<td class="type">
<span class="param-type">Array</span>
|
<span class="param-type">Object</span>
</td>
<td class="description last">The array of documents or a single document
that will be set as the collections data.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Optional options object.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line364">line 364</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".setData"><span class="type-signature">(static) </span>setData<span class="signature">(data)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the collection's data to the array / documents passed. If any
data already exists in the collection it will be removed before the
new data is set via the remove() method, and the remove event will
fire as well.
</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>data</code></td>
<td class="type">
<span class="param-type">Array</span>
|
<span class="param-type">Object</span>
</td>
<td class="description last">The array of documents or a single document
that will be set as the collections data.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Collection.js.html">Collection.js</a>, <a href="Collection.js.html#line350">line 350</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".setData"><span class="type-signature">(static) </span>setData<span class="signature">(data, options, callback)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the collection's data to the array / documents passed. If any
data already exists in the collection it will be removed before the
new data is set via the remove() method, and the remove event will
fire as well.
</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>data</code></td>
<td class="type">
<span class="param-type">Array</span>
|
<span class="param-type">Object</span>
</td>
<td class="description last">The array of documents or a single document
that will be set as the collections data.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">Optional options object.</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">Optional callback function.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source