Skip to content

Commit

Permalink
Restore documentation for Cursor#hint
Browse files Browse the repository at this point in the history
  • Loading branch information
erikolson186 committed Jun 11, 2017
1 parent bf956d0 commit c338839
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 12 deletions.
4 changes: 3 additions & 1 deletion docs/Collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ <h3 class="applicationName"><a href="index.html">ZangoDB</a></h3>

<li data-name="Cursor#group"><a href="Cursor.html#group">group</a></li>

<li data-name="Cursor#hint"><a href="Cursor.html#hint">hint</a></li>

<li data-name="Cursor#limit"><a href="Cursor.html#limit">limit</a></li>

<li data-name="Cursor#project"><a href="Cursor.html#project">project</a></li>
Expand Down Expand Up @@ -1501,7 +1503,7 @@ <h5>Example</h5>


<footer>
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Jun 07 2017 06:05:46 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Sun Jun 11 2017 10:30:26 GMT-0400 (Eastern Daylight Time)
</footer>
</div>
</div>
Expand Down
173 changes: 164 additions & 9 deletions docs/Cursor.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ <h3 class="applicationName"><a href="index.html">ZangoDB</a></h3>

<li data-name="Cursor#group"><a href="Cursor.html#group">group</a></li>

<li data-name="Cursor#hint"><a href="Cursor.html#hint">hint</a></li>

<li data-name="Cursor#limit"><a href="Cursor.html#limit">limit</a></li>

<li data-name="Cursor#project"><a href="Cursor.html#project">project</a></li>
Expand Down Expand Up @@ -287,7 +289,7 @@ <h4 class="name" id="filter">


<div class="tag-source">
cursor.js, line 150
cursor.js, line 160
</div>

</div>
Expand Down Expand Up @@ -630,7 +632,7 @@ <h4 class="name" id="group">


<div class="tag-source">
cursor.js, line 194
cursor.js, line 204
</div>

</div>
Expand Down Expand Up @@ -774,6 +776,159 @@ <h5>Example</h5>



<dt>
<div class="nameContainer">
<h4 class="name" id="hint">

hint<span class="signature">(path)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="Cursor.html">Cursor</a>}</span>
</h4>


<div class="tag-source">
cursor.js, line 133
</div>

</div>


</dt>
<dd>


<div class="description">
Suggest an index to use.<strong>Note:</strong> When an index hint is used only documentsthat contain the indexed path will be in the results.
</div>









<table class="params">
<thead>
<tr>

<th>Name</th>


<th>Type</th>



<th class="last">Description</th>
</tr>
</thead>

<tbody>


<tr>

<td class="name"><code>path</code></td>


<td class="type">


<span class="param-type">string</span>



</td>



<td class="description last">

An indexed path to use.</td>
</tr>


</tbody>
</table>



<dl class="details">





















</dl>











<h5>Returns:</h5>



<table class="params">
<thead>
<tr>

<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>

<tr>

<td class="type">

<a href="Cursor.html">Cursor</a>


</td>
<td class="description last"></td>
</tr>

</tbody>
</table>




<h5>Example</h5>



<pre class="prettyprint"><code>col.find().hint('myindex');</code></pre>



</dd>



<dt>
<div class="nameContainer">
<h4 class="name" id="limit">
Expand All @@ -783,7 +938,7 @@ <h4 class="name" id="limit">


<div class="tag-source">
cursor.js, line 160
cursor.js, line 170
</div>

</div>
Expand Down Expand Up @@ -936,7 +1091,7 @@ <h4 class="name" id="project">


<div class="tag-source">
cursor.js, line 180
cursor.js, line 190
</div>

</div>
Expand Down Expand Up @@ -1089,7 +1244,7 @@ <h4 class="name" id="skip">


<div class="tag-source">
cursor.js, line 170
cursor.js, line 180
</div>

</div>
Expand Down Expand Up @@ -1242,7 +1397,7 @@ <h4 class="name" id="sort">


<div class="tag-source">
cursor.js, line 228
cursor.js, line 238
</div>

</div>
Expand All @@ -1253,7 +1408,7 @@ <h4 class="name" id="sort">


<div class="description">
Sort documents.<strong>Note:</strong> An index will not be used for sortingunless the query predicate references one of the fields tosort by or Cursor#hint is used. This is so as not to excludedocuments that do not contain the indexed field, in accordancewith the functionality of MongoDB.
Sort documents.<strong>Note:</strong> An index will not be used for sortingunless the query predicate references one of the fields tosort by or <a href="Cursor.html#hint">Cursor#hint</a> is used. This is so as not to excludedocuments that do not contain the indexed field, in accordancewith the functionality of MongoDB.
</div>


Expand Down Expand Up @@ -1565,7 +1720,7 @@ <h4 class="name" id="unwind">


<div class="tag-source">
cursor.js, line 204
cursor.js, line 214
</div>

</div>
Expand Down Expand Up @@ -1880,7 +2035,7 @@ <h4 class="name" id="event:end">


<footer>
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Jun 07 2017 06:05:46 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Sun Jun 11 2017 10:30:26 GMT-0400 (Eastern Daylight Time)
</footer>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion docs/Db.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ <h3 class="applicationName"><a href="index.html">ZangoDB</a></h3>

<li data-name="Cursor#group"><a href="Cursor.html#group">group</a></li>

<li data-name="Cursor#hint"><a href="Cursor.html#hint">hint</a></li>

<li data-name="Cursor#limit"><a href="Cursor.html#limit">limit</a></li>

<li data-name="Cursor#project"><a href="Cursor.html#project">project</a></li>
Expand Down Expand Up @@ -1126,7 +1128,7 @@ <h5>Example</h5>


<footer>
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Jun 07 2017 06:05:46 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Sun Jun 11 2017 10:30:26 GMT-0400 (Eastern Daylight Time)
</footer>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ <h3 class="applicationName"><a href="index.html">ZangoDB</a></h3>

<li data-name="Cursor#group"><a href="Cursor.html#group">group</a></li>

<li data-name="Cursor#hint"><a href="Cursor.html#hint">hint</a></li>

<li data-name="Cursor#limit"><a href="Cursor.html#limit">limit</a></li>

<li data-name="Cursor#project"><a href="Cursor.html#project">project</a></li>
Expand Down Expand Up @@ -241,7 +243,7 @@ <h2>License</h2><p>MIT, please view the LICENSE file.</p></article>


<footer>
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Jun 07 2017 06:05:46 GMT-0400 (Eastern Daylight Time)
Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Sun Jun 11 2017 10:30:25 GMT-0400 (Eastern Daylight Time)
</footer>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions src/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ class Cursor extends EventEmitter {
}
}

/**
* Suggest an index to use.
* <strong>Note:</strong> When an index hint is used only documents
* that contain the indexed path will be in the results.
* @param {string} path An indexed path to use.
* @return {Cursor}
*
* @example
* col.find().hint('myindex');
*/
hint(path) {
this._assertUnopened();

Expand Down

0 comments on commit c338839

Please sign in to comment.